我将一个现有项目导入到我的android studio中,一切似乎都还可以,但是当我尝试使用数据电缆和android手机运行代码时,却多次得到此错误消息:
Error:Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes
最佳答案
您可以尝试multidex
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 15 //lower than 14 doesn't support multidex
targetSdkVersion 25
// Enabling multidex support.
multiDexEnabled true //You have already did this
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1' // add this in dependencies
}
您也可以尝试清理项目并重建项目,希望可以解决您的问题。
关于android - android studio将字节码转换为dex时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45204675/