构建失败:无法合并dex-Ionic

时间:2019-03-24 23:36:03

标签: ionic4

当我尝试编译时,出现以下错误:“任务':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
    }
}

0 个答案:

没有答案