Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij: android-support-v4.jar in included in actionBarSherlock and Project => IllegalArgumentException

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:

enter image description here

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:

enter image description here

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.

like image 988
Waza_Be Avatar asked Dec 31 '12 08:12

Waza_Be


1 Answers

Try to play with dependencies scopes and export flags. Check this page for the description: dependency tab.

like image 140
Mikita Belahlazau Avatar answered Oct 13 '22 23:10

Mikita Belahlazau