【问题标题】:Error import Eclipse project into Android Studio将 Eclipse 项目导入 Android Studio 时出错
【发布时间】:2015-05-21 13:55:50
【问题描述】:

当我将 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)

【问题讨论】:

标签: android eclipse import


【解决方案1】:

com.android.dex.DexIndexOverflowException: 方法 ID 不在 [0, 0xffff]: 65536

当您的应用程序及其引用的达到一定大小时,您会遇到构建错误,表明您的应用已达到 Android 应用构建架构的限制。

欲了解更多信息,请参阅Building Apps with Over 65K Methods

您可以使用以下方法来解决此问题

  1. 摆脱任何您并不真正需要的第三方库。
  2. 为您的应用程序使用multidex setup

【讨论】:

    猜你喜欢
    • 2023-03-03
    • 1970-01-01
    • 2015-08-17
    • 1970-01-01
    • 1970-01-01
    • 2015-05-13
    • 2015-06-21
    • 2017-07-22
    相关资源
    最近更新 更多