2017-08-31 31 views
1

當我使用Adobe Creative SDK時,我在構建APK時遇到以下錯誤。Adob​​e Creative SDK(Android) - 重複條目:com/google/android/gms/iid/zzc.class

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/iid/zzc.class

當我將minSdkVersion切換到21時,它會成功創建APK。我需要這個應用程式在ATLEAST版本上運行19

我的build.gradle文件:

apply plugin: 'com.android.application' 
apply plugin: 'realm-android' 
/* 1) Apply the Gradle Retrolambda Plugin */ 
apply plugin: 'me.tatarka.retrolambda' 

android { 
    compileSdkVersion 25 
    buildToolsVersion '25.0.2' 
    defaultConfig { 
     applicationId 'com.example.myapp' 
     minSdkVersion 20 
     targetSdkVersion 25 
     versionCode 10 
     versionName "2.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     manifestPlaceholders = [appPackageName: "${applicationId}"] 
     multiDexEnabled true 
     dexOptions { 
      jumboMode true 
     } 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    splits { 
     // Split apks on build target ABI, view all options for the splits here: 
     // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 
     abi { 
      enable true 
      reset() 
      include 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips', 'x86', 'x86_64' 
     } 
    } 

    /* 2) Compile for Java 1.8 or greater */ 
    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_8 
     targetCompatibility JavaVersion.VERSION_1_8 
    } 
    /* 3) Exclude duplicate licenses */ 
    packagingOptions { 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/DEPENDENCIES' 
     pickFirst 'AndroidManifest.xml' 
    } 
    android { 
     lintOptions { 
      disable 'MissingTranslation' 
     } 
    } 
    productFlavors { 
    } 
} 
ext.versionCodes = ['armeabi': 10, 'armeabi-v7a': 11, 'arm64-v8a': 12, mips: 13, 'x86': 14, 'x86_64': 15] 
import com.android.build.OutputFile 

android.applicationVariants.all { variant -> 
    // assign different version code for each output 
    variant.outputs.each { output -> 
     output.versionCodeOverride = 
       project.ext.versionCodes.get(output.getFilter(OutputFile.ABI)) * 1000 + android.defaultConfig.versionCode 
    } 
} 

repositories { 
    jcenter() 
    maven { url "http://kodbiro.github.io/repo/" } 
    maven { url "https://jitpack.io" } 
} 
dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile project(':kbimageview') 
    compile project(':PGSDK_V2.0') 
    compile project(':cropper') 
    compile project(':matisse') 
    /* 4) Add the CSDK framework dependencies (Make sure these version numbers are correct) */ 

    /* Add the CSDK framework dependencies (Make sure these version numbers are correct) */ 
    compile 'com.adobe.creativesdk.foundation:auth:0.9.1251' 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:support-v4:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'gun0912.ted:tedpermission:1.0.3' 
    compile 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1' 
    compile 'com.loopj.android:android-async-http:1.4.9' 
    compile 'com.kaopiz:kprogresshud:1.1.0' 
    compile 'com.github.ViksaaSkool:AwesomeSplash:v1.0.0' 
    compile 'com.valdesekamdem.library:md-toast:0.9.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.google.firebase:firebase-core:11.0.2' 
    compile 'com.google.firebase:firebase-auth:11.0.2' 
    compile 'com.google.firebase:firebase-messaging:11.0.2' 
    compile 'com.google.firebase:firebase-crash:11.0.2' 
    compile 'com.firebase:firebase-jobdispatcher:0.7.0' 
    compile 'me.everything:overscroll-decor-android:1.0.4' 
    compile 'com.synnapps:carouselview:0.1.4' 
    compile 'com.makeramen:roundedimageview:2.3.0' 
    compile 'com.github.florent37:viewanimator:1.0.5' 
    compile 'com.github.wooplr:Spotlight:1.2.3' 
    compile 'com.facebook.android:facebook-android-sdk:4.+' 
    compile 'com.adobe.creativesdk:image:4.8.4' 
    compile 'com.localytics.android:library:3.8.0' 
    testCompile 'junit:junit:4.12' 
} 
configurations.all { 
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1' 
} 
//https://stackoverflow.com/questions/45346959/duplicate-entry-com-google-android-gms-iid-zzc-class 
apply plugin: 'com.google.gms.google-services' 

gradlew app:dependencies輸出(無法將其粘貼在這裏,因爲輸出是非常大的): https://1drv.ms/t/s!AhQ7CrkhMU-0hs5kp4b2xPm5rUvoVw

回答

0

我排除從creativesdk com.google.android.gms解決此問題,使用下面的代碼:

compile ('com.adobe.creativesdk:image:4.8.4') { 
    exclude group: 'com.google.android.gms' 
}