解决method ID not in [0, 0xffff]: 65536错误的方法

来源:互联网 发布:2017全明星赛哈登数据 编辑:程序博客网 时间:2024/06/10 09:38

最近在做图片加载的时候出现Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536不知道怎么解决,于是百度了很久才找到答案,在此记录一下,好像是出现了超出了64k的限制
在 app 的build.gradle下添加两句就可以了

 defaultConfig {...multiDexEnabled true    }`

dependencies {
compile ‘com.android.support:multidex:’
}
“`
点击一下Sync Now重新编译一下就可以

0 0
原创粉丝点击