2017-08-11 279 views
-3

我导入了我的项目,从那以后我一直收到这个错误。 当我刚建立项目或使用'带gradle文件的同步项目'选项时,没有错误。java.util.zip.ZipException:重复条目:com/google/android/gms/auth/api/signin/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/auth/api/signin/zzc.class

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 26 
buildToolsVersion "26.0.1" 
defaultConfig { 
    applicationId "com.example.mahe.myapplication" 
    minSdkVersion 20 
    targetSdkVersion 26 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner" 
    multiDexEnabled true 

} 

dexOptions { 
    javaMaxHeapSize "4g" 
} 

buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro' 
    } 
} 
} 

    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 'com.google.firebase:firebase-core:11.0.4' 
compile 'com.google.firebase:firebase-auth:11.0.4' 
compile 'com.google.firebase:firebase-database:11.0.4' 
compile 'com.google.firebase:firebase-messaging:11.0.4' 
compile 'com.firebaseui:firebase-ui:0.6.2' 

compile 'com.google.android.gms:play-services-maps:11.0.4' 
compile 'com.android.support:appcompat-v7:26.0.1' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.android.support:customtabs:26.0.1' 
compile 'com.android.support:design:26.0.1' 

testCompile 'junit:junit:4.12' 
} 


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

allprojects { 
repositories { 
    jcenter() 
    maven { 
     url "https://maven.google.com" 
    } 
} 
} 

这是的build.gradle:

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 
     classpath 'com.google.gms:google-services:3.1.0' 


     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
     apply plugin: 'maven' 

    } 
} 

allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url "https://maven.google.com" 
     } 
    } 
} 

configurations.all { 
    resolutionStrategy.eachDependency { DependencyResolveDetails details -> 
     def requested = details.requested 
     if (requested.group == 'com.android.support') { 
      if (!requested.name.startsWith("multidex")) { 
       details.useVersion '26.0.1' 
      } 
     } 
    } 
} 
+0

本节没有设置'类路径“com.google.gms:谷歌服务:3.1.0''? –

+0

@IntelliJAmiya是的,我做到了。 –

+0

显示你的'build.gradle' –

回答

0

请参考:而试图建立的APK 我收到此错误https://github.com/firebase/FirebaseUI-Android#dependencies

必须使用FirebaseUI版本2.2.0(不是0.6.2)与Firebase/GooglePlay版本11.0.4


顺便问一下,你也可以删除从app/build.gradle

allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url "https://maven.google.com" 
     } 
    } 
} 
+0

我做什么ü问 可能是解决了,但给了我另一个错误 请帮我出这一点: 错误:任务':app:processDebugManifest'的执行失败。 > Manifest合并失败:属性meta-data#[email protected] value =(25.4.0)from [com.android.support:cardview-v7:25.4.0] AndroidManifest.xml:25:13-35 \t也出现在[com.android.support:customtabs:26.0.1] AndroidManifest.xml:25:13-35 value =(26.0.1)。 \t建议:在AndroidManifest.xml:23:9-25:38处添加'tools:replace =“android:value”'至元素以覆盖。 –

+0

你做了它说的吗? '建议:在AndroidManifest.xml中添加'tools:replace ='android:value''至元素' –

+0

是的,它没有改变anythimg 并删除maven存储库给出了很多错误 –

相关问题