使用生成工具21.0.0的DexIndexOverflowException

时间:2014-10-17 19:47:29

标签: android gradle android-studio dex

我将我的SDK更新到Android 5.0,Lollipop,并且还将构建工具更新到最新版本(v21.0.0)。现在,我在dex阶段遇到错误,我已在下面粘贴了。有谁知道如何解决这个问题?

/Applications/Android Studio.app/sdk/build-tools/21.0.0/dx --dex --num-threads=4 --output ...
  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)

0 个答案:

没有答案