0

When I import a Eclipse project to Android Studio I see this error:

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    C:\Users\Bernardo\android-sdks\build-tools\21.1.2\dx.bat --dex --no-optimize --output C:\Users\Bernardo\AndroidstudioProjects\RcForcaVendas\app\build\intermediates\dex\debug --input-list=C:\Users\Bernardo\AndroidstudioProjects\RcForcaVendas\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: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)
Leandro Carracedo
  • 7,233
  • 2
  • 44
  • 50

1 Answers1

0

com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

When your application and the libraries it references reach a certain size, you encounter build errors that indicate your app has reached a limit of the Android app build architecture.

For more info see Building Apps with Over 65K Methods

You may use following ways to overcome this issue as

  1. Get rid of any third-party libraries that you don't really need.
  2. Use a multidex setup for your application.
Giru Bhai
  • 14,370
  • 5
  • 46
  • 74