更新了我的google play服务和google存储库后,我还更新了我的firebase sdk,当我开始运行应用程序时出现此错误,但是当我对它进行gradle时,没有编译错误。
这是我得到的错误:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / android / gms / auth / api / signin / internal / zzf.class
这是我的gradle app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.myapp.maecea.ipon4"
minSdkVersion 16
targetSdkVersion 24
versionCode 5
versionName "5.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.firebaseui:firebase-ui-database:0.4.0'
compile 'com.firebaseui:firebase-ui:0.4.0'
}
apply plugin: 'com.google.gms.google-services'
虽然这是我的gradle项目:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是我更新的依赖项:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.myapp.maecea.ipon4"
minSdkVersion 16
targetSdkVersion 24
versionCode 5
versionName "5.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.firebaseui:firebase-ui-database:0.4.0'
compile 'com.firebaseui:firebase-ui:0.4.0'
}
apply plugin: 'com.google.gms.google-services'
答案 0 :(得分:1)
要解决无法解决的次要问题:com.twitter.sdk.android:twitter:2.2.0 ,请更新您的顶级(Project)build.gradle文件以包含这些存储库:
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
}
这取自Firebase UI示例应用的project build file。
答案 1 :(得分:0)
添加播放服务。
compile 'com.google.android.gms:play-services-auth:10.2.1'