【问题标题】:com.android.dex.DexIndexOverflowException: method ID not in [0, > 0xffff]: 65536com.android.dex.DexIndexOverflowException:方法 ID 不在 [0, > 0xffff] 中:65536
【发布时间】:2017-07-12 05:32:24
【问题描述】:

当我在我的设备上运行时,它工作正常但是在 android studio 中构建 apk 时显示错误:

构建 APK:构建 APK 时出错。您可以在 “消息”视图

这是错误:

错误:任务执行失败 ':app:transformClassesWithDexForDebug'。 com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: 方法 ID 不在 [0, 0xffff]: 65536

【问题讨论】:

  • 什么是错误?请发布您的错误。
  • you can find the errors in the Messages view你检查过消息视图吗?
  • 构建 APK:构建 APK 时出错。您可以在“消息”视图中找到错误
  • 从消息视图中显示错误
  • 至少你需要发布一些代码和错误信息来解决你的错误。

标签: android android-gradle-plugin build.gradle


【解决方案1】:

从我的项目中删除 jar 文件后问题得到解决。似乎我项目中的一个 jar 文件正在使用 google play 服务

【讨论】:

    【解决方案2】:

    今天早上我也遇到了同样的问题。您可能已经达到了 dex 文件中可以有多少方法的上限(通过有很多依赖项)。

    解决办法是开启multiDex; This other SO answer on the topic 解释得比我以往任何时候都好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-19
      • 2014-11-13
      相关资源
      最近更新 更多