UNCERTAINT FUEL EXCLUSION: In Android Studio, not in Eclipse

I have a problem when I try to build my project, here is my structure: ActionBarSherlock (Project lib) → (linked) Project (Lib) → (linked) with project test

When I try to run a project test on eclipse, everything is fine, but when I changed for Android Studio, I have this problem:

Android Dex: [sample] UNEXPECTED TOP-LEVEL EXCEPTION: Android Dex: [sample] java.lang.IllegalArgumentException: already added: Lcom/myClassPath/MyClassName; Android Dex: [sample] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) Android Dex: [sample] at com.android.dx.dex.file.DexFile.add(DexFile.java:163) Android Dex: [sample] at com.android.dx.command.dexer.Main.processClass(Main.java:490) 

Can someone help me please Thanks

+4
source share
3 answers

You need to check the modules of both projects. Make sure they both use the same version of the support library (or any other lib that they use).

+6
source

A Build -> Clean Project and a complete new build did the trick for me.

+1
source

I ran into this problem. My fix was different, however ...

 Android Dex: [sample] java.lang.IllegalArgumentException: already added: Lcom/myClassPath/MyClassName; 

It turns out that MyClassName was in two different modules. In both places, the class had the same package name.

To fix this, I simply deleted the one that was in the wrong place. To find out where it is, you can CTRL + SHIFT + F for the “MyClassName class”, which should show you all the instances where this class is defined.

0
source

Source: https://habr.com/ru/post/1481211/


All Articles