Add android support library v4 to intellij ide

13,042

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:

incorrect

Correct configuration:

correct

Share:
13,042
user1233587
Author by

user1233587

Updated on June 05, 2022

Comments

  • user1233587
    user1233587 about 2 years

    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