在更新了我的 google play 服务和 google 存储库后,我还更新了我的 firebase sdk,当我开始运行应用程序时出现此错误,但是当我对其进行 gradle 时,没有编译错误.
这是我得到的错误:
错误:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败.<块引用>
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/google/android/gms/auth/api/signin/internal/zzf.class
这是我的 gradle 应用程序:
应用插件:'com.android.application'安卓 {compileSdkVersion 24构建工具版本24.0.2"默认配置 {应用程序IDcom.myapp.maecea.ipon4"minSdkVersion 16targetSdkVersion 24版本代码 5版本名称5.0"multiDexEnabled 真}构建类型 {发布 {缩小启用假proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}依赖{编译文件树(包括:['*.jar'],目录:'libs')测试编译'junit:junit:4.12'编译'com.android.support:appcompat-v7:24.2.0'编译'com.android.support:recyclerview-v7:24.2.0'编译'com.google.firebase:firebase-database:10.0.1'编译'com.google.firebase:firebase-auth:10.0.1'编译'com.firebase:firebase-client-android:2.3.1'编译 'com.firebaseui:firebase-ui-database:0.4.0'编译'com.firebaseui:firebase-ui:0.4.0'}应用插件:'com.google.gms.google-services'虽然这是我的 gradle 项目:
//顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项.构建脚本 {存储库{中心()}依赖{类路径'com.android.tools.build:gradle:2.1.3'类路径 'com.google.gms:google-services:3.0.0'//注意:不要将您的应用程序依赖项放在这里;他们属于//在单个模块 build.gradle 文件中}}所有项目{存储库{中心()mavenLocal()}}任务清理(类型:删除){删除 rootProject.buildDir}这是我更新的依赖项:
应用插件:'com.android.application'安卓 {compileSdkVersion 24构建工具版本24.0.2"默认配置 {应用程序IDcom.myapp.maecea.ipon4"minSdkVersion 16targetSdkVersion 24版本代码 5版本名称5.0"multiDexEnabled 真}构建类型 {发布 {缩小启用假proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}依赖{编译文件树(包括:['*.jar'],目录:'libs')测试编译'junit:junit:4.12'编译'com.android.support:appcompat-v7:24.2.0'编译'com.android.support:recyclerview-v7:24.2.0'编译'com.google.firebase:firebase-database:10.0.1'编译'com.google.firebase:firebase-auth:10.0.1'编译 'com.firebaseui:firebase-ui-database:0.4.0'编译'com.firebaseui:firebase-ui:0.4.0'}应用插件:'com.google.gms.google-services'为了解决Failed to resolve: com.twitter.sdk.android:twitter:2.2.0的次要问题,更新你的顶级(项目)build.gradle 文件以包含这些存储库:
存储库 {中心()mavenLocal()mavenCentral()maven { url 'https://maven.fabric.io/public' }}}这取自 项目构建文件 用于 Firebase 用户界面示例应用.
After updated my google play services and google repository, I also updated my firebase sdk and I get this error when I start running the app but when I gradle it no errors was compile.
This is the error I got:
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/internal/zzf.class
This is my 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'
While this is my gradle project:
// 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
}
This is my updated dependencies:
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'
To resolve the secondary problem of Failed to resolve: com.twitter.sdk.android:twitter:2.2.0, update your top-level (Project) build.gradle file to include these repositories:
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
}
This is taken from the project build file for the Firebase UI sample app.
这篇关于重复条目:com/google/android/gms/auth/api/signin/internal/zzf.class的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
为什么在 Eclipse 的 SDK 中选择 Android API 而不是 Why would you choose Android API over Google APIs in the SDK on Eclipse?(为什么在 Eclipse 的 SDK 中选择 Android API 而不是 Google API?)
Couchbase 存储桶身份验证错误Couchbase Bucket authentication error(Couchbase 存储桶身份验证错误)
admob 6.2.1 空指针异常admob 6.2.1 nullpointer exception(admob 6.2.1 空指针异常)
如何在 IntelliJ IDEA 中设置 SDK?How to setup SDK in IntelliJ IDEA?(如何在 IntelliJ IDEA 中设置 SDK?)
eclipse 无法检测到我的手机进行试运行My phone cannot be detected in eclipse to test run(eclipse 无法检测到我的手机进行试运行)
android SDK 中缺少 platform-toolsaapt.exe 目录platform-toolsaapt.exe directory missing in android SDK(android SDK 中缺少 platform-toolsaapt.exe 目录)