2

Im trying to import a custom gauge library made by someone ( Simple gauge view like speedmeter in android? ) into my project in android studio. It imports fine however, when I build the project i get the following error:

I have no idea what to look for, what this is or how to fix it. Any help is appreciated.

Thanks!

EDIT: the complete error message that im getting is:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.command.Main.main(Main.java:106)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.command.dexer.Main.run(Main.java:246)
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_67\bin\java.exe'' finished with non-zero exit value 2
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)

Im guessing it has something to do with accessing two files (Landroid/support/annotation/AnimeRes) at the same time like it is refered to here ListViewAnimations Library Causes TOP-LEVEL-EXCEPTION But i cant find this file to test it.

Community
  • 1
  • 1
Celly
  • 325
  • 1
  • 14
  • Can you try `./gradlew assembleDebug` from the terminal and copy and paste the exact stack – hoomi Mar 16 '15 at 10:30
  • when i type ./gradlew assembleDebug in android studio terminal it says './gradlew' not recognized @hoomi – Celly Mar 16 '15 at 18:32
  • @Celly have you seen this question http://stackoverflow.com/questions/26342444/multiple-dex-files-define-landroid-support-annotation-animres – Kibi Mar 19 '15 at 08:56
  • No, actually i missed that one. Thank you. I have deleted my old project now and started a new as my answer so unfortunately i cant check it now, but ill remember it for sure @Kibi – Celly Mar 19 '15 at 10:11

1 Answers1

0

After few days of itching my head and going through some possible reasons like this one After import from Eclipse to Android Studio cannot run Execution failed for task ':app:dexDebug" i found out that it has something to do with referencing the wrong library or that for some odd reason there are multiple files that define the AnimeRes file in the external library as stated by the error log:

Multiple dex files define Landroid/support/annotation/AnimRes; 

I just made a new project from scratch and it worked. Im still not entirely sure of the cause.

Community
  • 1
  • 1
Celly
  • 325
  • 1
  • 14