Android: Load Cardview,recyclerview Exception Solution

Source: Internet
Author: User

  this afternoon, I added support for Recyclerview in my project, but always quoted "caused By:java.lang.NoClass Deffound

error:android.support.v7.recyclerview.r$styleable"Anomaly, in the online search for a, silly afternoon still did not solve the problem, and finally try to start from the initial loading class library to find problems, The final reason for finding out is that you want to kill yourself.

Let's start from the beginning:

First of all, we recommend that you use Google's Android support library, do not use the direct. \sdk\extras\android\m2repository

Xx.aar files in \com\android\support\recyclerview-v7 are copied to the Libs directory, add build path this way, or import Android code the most official I do not know how to import the author see the official Google Link: http://developer.android.com/tools/support-library/setup.html#libs-with-res.

Second, for loading cardview,recyclerview times out of the exception of one is Android-support-v4.jar this package version mismatch, the other is after the Android support library, click the right mouse button-- properties--android--Check is library-- click Apply. Remember to click Apply to apply the current change, otherwise the configuration will fail. I was after the Recyclerview package, did not click Apply, the results have been reported above the red label anomalies, troubled me an afternoon.

Finally, the Complete Guide package practice list, convenient for everyone to check.  

    • Select File > Import.
    • Select Existing Android Code into Workspace and click Next.
    • Browse to the SDK installation directory and then to the support Library folder. For example, if is adding the appcompat project, browse to <sdk>/extras/android/support/v7/appcompat/ .
    • Click Finish to import the project. For the V7 AppCompat project, you should now see a new project titled Android-support-v7-appcompat.
    • In the Order and Export tab, check the .jar files you just added to the build path, so they is available to Pro Jects that depend in this library project. For example, the appcompat project requires your to export both the android-support-v4.jar and android-support-v7-appcompat.jar files.
    • Right-click the Library project folder and select Properties > Check is library>click Apply.
    • Click OK to complete the changes.

Android: Load Cardview,recyclerview Exception Solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.