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