java.lang.IllegalStateException: Dex archives: setting .DEX.........
Dex异常记录
java.lang.IllegalStateException: Dex archives: setting .DEX extension only for .CLASS files
该异常一般是jar或者是aar导致的包重复导入,直接使用
全局统一
configurations.all {
resolutionStrategy {
eachDependency { details ->
// Force all of the primary support libraries to use the same version.
if (details.requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.+'
}
}
}
}
}
这个时候项目会有一个缓存,导致执行了上面的操作还是会一直报错
删掉build.gradle 即可
灵感来源
https://cloud.tencent.com/developer/article/1499666
本文地址:https://blog.csdn.net/qq_32216895/article/details/108844346
上一篇: Android使用JetPack入门实例