Android 65535

在开发中遇到了这个错,来看一下报错信息;

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

解决办法:

在module app中 导入
1、// 避免方法数超过64k
compile 'com.android.support:multidex:1.0.1'
2、 //避免超过64k的方法
protected void attachBaseContext(Context base) {
super .attachBaseContext(base);
MultiDex. install ( this );
}



猜你喜欢

转载自blog.csdn.net/qq_38875767/article/details/80990549
今日推荐