I am trying to use viewpager from android support library v4 in intelli j. Currently, I am using the Android SDK 4.1
I copied android-support-v4.jar
to my intellij android project under 'libs'
in the project settings of intellij
I went to "Modules" => "MyModuleName" => dependencies tab, and add the android-support-v4.jar, by navigating the path to the libs/ folder under my own project
I checked the 'export' besides this newly added jar file
but I still can't use viewpager in my application.
I get a crash msg like:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxxx/com.xxxx.MyActivity}: android.view.InflateException: Binary XML file line #13: Error inflating class android.support.v4.view.ViewPager
I've inspected the project you provided and found the problem to be caused by the incorrect library configuration. When adding a library, you've specified android
folder inside the jar
instead of specifying the jar
itself.
Incorrect configuration:
Correct configuration:
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