Intellij: android-support-v4.jar in included in actionBarSherlock and Project => IllegalArgumentException
android, intellij-idea, jar
Solution
Try to play with dependencies scopes and export flags. Check this page for the description: dependency tab.
Problem
I am currently migrating all my projects from Eclipse to IntelliJ Idea. When I was using Eclipse, the package was only included in ActionBarSherlock library and when the library was included in my project, everything was automatically added. With IntelliJ, once the android-support-v4.jar is added to ABS, that does not seems enough, as all my imports are broken. Screenshot of ActionBarSherlock (LibABS) imports: Everything seems fine, all the SherlockActivity are fine, but all the stuff related to support is not recognized in my application: ``` java: /home/user/workspace/.... cannot access android.support.v4.app.FragmentActivity class file for android.support.v4.app.FragmentActivity not found ``` So, I have to copy manually the jar into a libs folder and include it to my project once again. Screenshot of my project imports: The imports are recognized, nut I now get this error: ``` Android Dex: [BeTrains-for-Android] UNEXPECTED TOP-LEVEL EXCEPTION: Android Dex: [BeTrains-for-Android] java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ShareCompat$ShareCompatImplJB; ``` Thank a lot for any help.