当我尝试编译时,出现以下错误:“任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug的执行失败。
java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex“
我已经尝试了一切。
Cordova clean,清理所有android并重建,但是什么也没发生。
这是我的build.gradle
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.google.gms:google-services:4.2.0'
}
}
// use postBuildExtras to make sure the plugin is applied after
// cdvPluginPostBuildExtras. Therefore if googleServices is added
// to cdvPluginPostBuildExtras somewhere else, the plugin execution
// will be skipped and project build will be successfull
ext.postBuildExtras = {
if (project.extensions.findByName('googleServices') == null) {
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
}
}