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

xiaoxiao2021-02-28  59

编译报错:

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

之类的报错的话,多半是由于项目中引入的库多而且太大,这些模块需要生成一个Dex放进AAR包里给App使用,现在这个Dex生成不了了,提示太大,就是这个原因。

解决办法:

在Module的build.gradle文件的android节点中的defaultConfig节点添加:multiDexEnabled true即可。

android { compileSdkVersion 26 buildToolsVersion '25.0.3' defaultConfig { applicationId " " minSdkVersion 16 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true //Howard 2017-08-31 解决方法数超过65536的问题 } }
转载请注明原文地址: https://www.6miu.com/read-2628370.html

最新回复(0)