I'm using IntelliJ/Android Studio with Ant build (not Gradle at the moment), and am trying to use android-support-v7-cardview.jar but I continue to get
android.view.InflateException: Binary XML file line #19: Error inflating class android.support.v7.widget.CardView
java.lang.NoClassDefFoundError: android.support.v7.cardview.R$styleable
I am not using m2repository with the aar file, but am using the cardview at location
sdk/extras/android/support/v7
I have gotten it to work by using the classes from the jar in my own project, but it requires API 21 (5.0) which I don't want to use yet. I am trying to use the jar file in the libs folder and res files from
sdk/extras/android/support/v7/cardview/res
I have added the lib file and res files to my own project, but still get the error messages above. What should I do?
I had the exact same problem after adding compile 'com.android.support:cardview-v7:23.2.1'
to build.gradle's dependencies to use the CardView, however after cleaning the project (Build > Clean Project) everything worked like magic.
Hi this might be helpful, this worked for me. (for intellij users)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With