2017-09-03 79 views
0

更新Android工作室和幾個依賴後,我現在收到此錯誤信息機器人:錯誤:執行失敗的任務「:應用程序:transformClassesWithJarMergingForDebug」

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

這是我的gradle這個文件 應用插件:「com.android 。應用」

apply plugin: 'io.fabric' 

repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

apply plugin: 'com.google.firebase.firebase-perf' 



android { 
    compileSdkVersion 26 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "REMOVED_FOR_PRIVACY" 
     minSdkVersion 16 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 

    } 
    buildTypes { 
     release { 
      minifyEnabled false 

      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 
buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     // These docs use an open ended version so that our plugin 
     // can be updated quickly in response to Android tooling updates 

     // We recommend changing it to the latest version from our changelog: 
     // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 

    // compile 'com.firebaseui:firebase-ui:1.2.0' 

    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 






    compile 'com.android.support:appcompat-v7:26.0.2' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:mediarouter-v7:26.0.2' 
    compile 'com.google.android.gms:play-services-location:11.2.0' 
    compile 'com.google.firebase:firebase-core:11.2.0' 
    compile 'com.google.firebase:firebase-crash:11.2.0' 
    compile 'com.google.firebase:firebase-auth:11.2.0' 
    compile 'com.google.firebase:firebase-messaging:11.2.0' 
    compile 'com.google.firebase:firebase-database:11.2.0' 
    compile 'com.google.firebase:firebase-perf:11.2.0' 
    compile 'com.firebaseui:firebase-ui-auth:2.0.1' 
    compile 'com.facebook.android:facebook-android-sdk:[4,5)' 
    compile 'com.android.support:design:26.0.2' 
    compile 'com.github.bumptech.glide:glide:4.0.0' 
    compile 'com.android.support:support-v4:26.0.2' 
    compile 'com.android.support:multidex:1.0.1' 
    annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0' 
    testCompile 'junit:junit:4.12' 
} 



apply plugin: 'com.google.gms.google-services' 

我已經嘗試過清理和重建項目,但似乎沒有任何工作

回答

0

提高你的構建工具版本:

buildToolsVersion "26.0.2" 

,並排除來自Facebook的播放服務,例如

compile ('com.facebook.android:facebook-android-sdk:[4,5)'){ 
    exclude group:"com.google.android.gms" 
} 
+0

我更新替換

'com.google.android.gms:play-services-location:11.2.0' 

我的構建到「26.0.1」,但它仍然是不工作。我不認爲有一個「26.0.2」 –

+0

請檢查更新的答案 –

+0

這也沒有工作實際工作取代'com.google.android.gms:play-services-location:11.2.0'與'com.google.android.gms:play-services:11.2.0' –

0

好什麼似乎實際工作與

'com.google.android.gms:play-services:11.2.0' 
+0

這是編譯太多的庫,如果你想要的是位置包 –

+0

作爲參考。 https://stackoverflow.com/questions/39008887/how-do-i-show-dependencies-tree-in-android-studio/39020703#39020703 –

+0

我知道,但這是唯一的解決方案,現在正在工作。所以我會一起去,直到我知道這一點。另外當我使用位置庫時,我會收到與先前版本的庫衝突的警告。我認爲我必須刪除舊的,所以我會嘗試 –

相關問題