kloder-games / godot-admob

Module Admob for Godot engine
MIT License
360 stars 61 forks source link

Godot Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'. #111

Closed ghost closed 5 years ago

ghost commented 5 years ago

OS target Android:

Godot version: 1.3.1

Issue description: I am using admob and google play services When i tried to compile with .\gradlew build an error is shown:

Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\0.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\1.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\2.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\3.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\4.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\5.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\6.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\7.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\8.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\9.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\10.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\11.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\12.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\13.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\14.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\15.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\16.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\17.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\18.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\19.jar, C:\tmp\godot\platform\android\java\build\intermediates\transforms\dexBuilder\debug\20.jar
  Program type already present: com.google.android.gms.common.internal.zzd
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

My build.gradle file looks like this:

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'

    }
}

apply plugin: 'com.android.application'

allprojects {
    repositories {
    mavenCentral()
    google()
    jcenter()

    }
}

dependencies {
        implementation "com.android.support:support-core-utils:28.0.0"
    compile ('com.google.android.gms:play-services-ads:16.0.0') { exclude group: 'com.android.support' }
    compile 'com.google.android.gms:play-services-plus:9.8.0'
    compile 'com.google.android.gms:play-services-drive:9.8.0'
    compile 'com.google.android.gms:play-services-games:9.8.0'

}

android {

    lintOptions {
        abortOnError false
        disable 'MissingTranslation','UnusedResources'
    }

    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    useLibrary 'org.apache.http.legacy'

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
    defaultConfig {
        minSdkVersion 18
        targetSdkVersion 28

    }
    // Both signing and zip-aligning will be done at export time
    buildTypes.all { buildType ->
        buildType.zipAlignEnabled false
        buildType.signingConfig null
    }
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src'
                ,'C:/tmp/godot/modules/admob/android','C:/tmp/godot/modules/gpgs/android'
            ]
            res.srcDirs = [
                'res'

            ]
            aidl.srcDirs = [
                'aidl'

            ]
            assets.srcDirs = [
                'assets'

            ]
        }
        debug.jniLibs.srcDirs = [
            'libs/debug'

        ]
        release.jniLibs.srcDirs = [
            'libs/release'

        ]
    }

    applicationVariants.all { variant ->
        variant.outputs.all { output ->
            output.outputFileName = "../../../../../../../bin/android_${variant.name}.apk"
        }
    }
}

Any help is greatly appreciated!