7
votes

UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536 Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: /home/prem/Development/Android-sdk/sdk/build-tools/21.0.1/dx --dex --no-optimize --output /home/prem/currencysave/Android/CurrencySave/app/build/intermediates/dex/debug --input-list=/home/prem/currencysave/Android/CurrencySave/app/build/intermediates/tmp/dex/debug/inputList.txt Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536 at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502) at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277) at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168) 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:302) at com.android.dx.command.dexer.Main.run(Main.java:245) at com.android.dx.command.dexer.Main.main(Main.java:214) at com.android.dx.command.Main.main(Main.java:106)

1
This is your error, then what is your question?Arulkumar
@Arulkumar - that's not helpful - a seemingly obscure error message has a perfectly obvious implied question of "Why did this happen? How can I fix it?" That's not to say the question shouldn't be closed - it is perfectly clear and as ligi has demonstrated answerable, but it is also a duplicate of one that has been asked here quite a few times before.Chris Stratton
@user1992200- Thank you it helps me.PAC
@Chris Stratton - Thank you for your support. But I edited the question for more clarity for others.PAC

1 Answers

10
votes

You run into the method count limit. Either you use multidex or reduce the number of methods ( e.g. with proguard ) Please read this: https://developer.android.com/tools/building/multidex.html