Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0)

后端 未结 8 1691
[愿得一人]
[愿得一人] 2020-12-08 03:58

When I use implementation \'com.google.firebase:firebase-inappmessaging-display:17.2.0\' in my app/build.gradle, I get this error:



        
8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 04:25

    I encountered the same problem. I added the line below

    implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
    

    This works but I encountered another issue- Cannot fit requested classes in a single dex file (# methods: 89411 > 65536) To resolve this error make sure to enable multiDex as below

    defaultConfig {
        applicationId "com.techweezy.smartsync"
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 5
        versionName "1.4"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true //added this line
    }
    

    Then finally add the below lines.

       implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
        implementation 'androidx.multidex:multidex:2.0.1'
    

提交回复
热议问题