Build conflict in Firebase ver 11.0.0 and guava (Duplicate zip entry [classes.jar:com/google/common/base/FinalizableReference.class])

时间:2017-06-12 16:55:56

标签: android firebase android-guava

I have upgraded my project to latest version of Google Play Services, including Firebase (version 11.0.0) and I am not able to build the project anymore due to conflict between Guava's and Firebase's version of the class com/google/common/base/FinalizableReference.class

At previous version Firebase it did not contain com/google/common/base/FinalizableReference.class

I have the following build grade:

android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
    applicationId "com.example.app.myapplication"
    minSdkVersion 19
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
}
buildTypes {
    debug {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-android-optimize.txt'
    }
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-android-optimize.txt'
    }
}

lintOptions {
    abortOnError false
}
}dependencies {
    compile ('com.google.firebase:firebase-core:11.0.0')
    compile ('com.google.guava:guava:22.0-android')
}

and the proguard-android-optimize.txt file is

-verbose
-dontoptimize
-ignorewarnings
-dontshrink
-dontwarn com.google.common.**
-dontwarn com.google.android.gms.**
-dontwarn javax.lang.model.element.**

-dontwarn com.google.common.base.FinalizableReference
-keep class com.google.common.base.FinalizableReference

-dontwarn com.google.common.base.internal.Finalizer
-keep class com.google.common.base.internal.Finalizer

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

1 个答案:

答案 0 :(得分:0)

GitHub上的Google员工已经承认了这个问题,并表示正在修复工作。

我个人认为这是一个bug而不仅仅是声明了一个Guava依赖。我不得不同时将Play服务回滚到10.2.6。

供您参考 - Response to this on GitHub