Error:Error converting bytecode to dex: Cause: com.android.dex.DexIndexOverflowException: Cannot merge new index 66596 into a non-jumbo instruction!

Error:Error converting bytecode to dex:

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

在app的build.gradle里添加

defaultConfig {

...

multiDexEnabled   true

...

}

dependencies {

...

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

...

}

没有加下面也好使

3、AndroidManifest.xml中添加 android:name = "android.support.multidex.MultiDexApplication"

如果项目中已经使用了Applicaiton可以提供的解决方法是让自己的Application继承MultiDexApplication或者在Application的attachBaseContext方法中添加

@Override

protectedvoidattachBaseContext(Context base) {

super.attachBaseContext(base);

MultiDex.install(this);

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容