1. 程式人生 > >com.android.dex.DexIndexOverflowException: Cannot merge new index 66299 into a non-jumbo instruction

com.android.dex.DexIndexOverflowException: Cannot merge new index 66299 into a non-jumbo instruction

/*dexOptions {
    jumboMode true
}*/

使用Gradle方式:

如果編譯成功,執行提示

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/zhaokun/work/jdk1.7.0_71/bin/java'' finished with non-zero exit value 2

可以在工程根目錄下執行./gradlew installDebug --stacktrace,或者在IDE視窗Gradle console 發現有下面的提示

com.android.dex.DexIndexOverflowException: Cannot merge new index 65949 into a non-jumbo instruction!

在主工程的build.gradle檔案,android{} 內新增如下內容

    android.dexOptions {
        jumboMode = true
//        javaMaxHeapSize "2g"
    }
Eclipse 中是在project.properties中新增dex.force.jumbo=true

參考:https://www.baidu.com/s?tn=87048150_pg&word=jumboMode%20true