【问题标题】:Getting exception in Android Studio [duplicate]在 Android Studio 中获取异常 [重复]
【发布时间】:2017-01-03 06:08:20
【问题描述】:

每次在我的 android studio 中,我都会遇到异常,请帮助我

错误:任务 ':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

【问题讨论】:

  • 你能发布你的 gradle 代码吗?

标签: android


【解决方案1】:

您必须启用多 dex,您的应用程序中不能有超过 65k 的方法,要启用多 dex,请执行此操作

在应用级 build.gradle 中

 defaultConfig {
    applicationId "com.myapp.ebook"
    minSdkVersion 14
    targetSdkVersion 21
    multiDexEnabled true

}

dependencies {

compile 'com.android.support:multidex:1.0.1'

 }

你可以通过Here找到完整的文档

【讨论】:

    猜你喜欢
    • 2012-09-11
    • 1970-01-01
    • 2020-10-02
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 1970-01-01
    • 2021-05-07
    相关资源
    最近更新 更多