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);

}

你可能感兴趣的:(Error:Error converting bytecode to dex: Cause: com.android.dex.DexIndexOverflowException: Cannot merge new index 66596 into a non-jumbo instruction!)