Olusegun Odumosu Olusegun Odumosu - 1 year ago 166
Android Question

app:dexRelease error when generatingsigned apk in Android Studio

I'm trying to generate a signed apk but when I build my project i keep getting this error:

Error:Execution failed for task ':app:dexRelease'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/AzeezOlusegunOdumosu/android-sdks/build-tools/21.1.2/dx --dex --output /Users/AzeezOlusegunOdumosu/AndroidStudioProjects/RCCGSPP/app/build/intermediates/dex/release --input-list=/Users/AzeezOlusegunOdumosu/AndroidStudioProjects/RCCGSPP/app/build/intermediates/tmp/dex/release/inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/parse/AbstractQueryController$1;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
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.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)

Answer Source

com.android.dex.DexException: Multiple dex files define

This line means that you have multiple copies of the same library in your dependencies which are clashing. Probably some parse library which you are using.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download