Error:Error converting bytecode to dex: Cause: com.android.dex.DexIndexOverflowException: Cannot mer

android studio 遇到问题:Error:Error converting bytecode to dex:

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

解决方式

1.在主工程bulid.gradle 中dependncies中添加代码,分包设置

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

Error:Error converting bytecode to dex: Cause: com.android.dex.DexIndexOverflowException: Cannot mer

2.在defaultConfig节中设置multiDexEnabled标签为true,开启multi-dexing支持

Error:Error converting bytecode to dex: Cause: com.android.dex.DexIndexOverflowException: Cannot mer