当我将Eclipse项目导入Android Studio时,我看到了这个错误:
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)
答案 0 :(得分:0)
com.android.dex.DexIndexOverflowException:方法ID不在[0, 0xffff]:65536
当您的应用和库引用达到一定大小时,您会遇到构建错误,表明您的应用已达到Android应用构建架构的限制。< / p>
有关详细信息,请参阅Building Apps with Over 65K Methods
您可以使用以下方法来解决此问题