Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UNEXPECTED TOP-LEVEL EXCEPTION: On Android Studio and not Eclipse

I have an issue when I try to build my project, here my structure : ActionBarSherlock (Project lib) -->(linked) A Project (Lib) -->(linked) to Project Test

When I try to run the project test on eclipse every things are fine but when I changed for Android Studio I have that issue:

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)

Someone can help me, please Thanks

like image 996
douarbou Avatar asked Mar 23 '23 22:03

douarbou


2 Answers

You have to check the modules of both projects. Make sure they are both using the same version of the support library (or any other lib they are both using).

like image 183
Ahmad Avatar answered Mar 26 '23 11:03

Ahmad


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

like image 20
saiyancoder Avatar answered Mar 26 '23 11:03

saiyancoder