【发布时间】:2017-10-22 17:49:24
【问题描述】:
我使用这个依赖项
compile 'com.google.firebase:firebase-auth:11.4.2'
Error:
错误:任务 ':app:transformResourcesWithMergeJavaResForDebug' 执行失败。
com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:在 APK META-INF/maven/com.fasterxml.jackson.core/jackson-core/pom 中复制的文件重复。特性 文件 1:C:\Users\Usman.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.2.2\d20be6a5ddd6f8cfd36ebf6dea329873a1c41f1b\jackson-core-2.2.2.jar 文件 2:D:\eRozgaar\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-basement\11.4.2\jars\classes.jar
我的 build.gradil 是:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.usman.erozgaar"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
packagingOptions
{
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.firebase:firebase-client-android:2.5.2+'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.android.volley:volley:1.0.0'
// compile 'com.google.firebase:firebase-core:10.0.1'
// compile 'com.firebase:firebase-ui-storage:0.6.0'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.firebase:firebase-database:11.0.1'
compile 'com.google.firebase:firebase-storage:11.0.1'
}
【问题讨论】:
-
我可以看看你的 build.gradle 吗?
-
@Giovanni Terlingen 检查我的 build.gradle
-
检查我的答案,你是否也排除了 maven 文件夹?
-
是的,但仍然显示相同的错误。
-
阅读我的回答。您的依赖项位于 PackagingOptions 之下,它们需要位于顶部!
标签: android firebase-authentication