Nathan
Nathan

Reputation: 165

Android Studio - Duplicate classes ... found in modules ... and

I've been looking around for hours, yet I can't find any explanation that fits with my situation.

Every time I build my project, I get this same error:

Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules jetified-guava-20.0 (com.google.guava:guava:20.0) and jetified-listenablefuture-1.0 (com.google.guava:listenablefuture:1.0)

Go to the documentation to learn how to Fix dependency resolution errors.

Yet I have absolutely no idea which dependencies are causing this.

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
def dynamicanimation_version = '1.0.0'
implementation "androidx.dynamicanimation:dynamicanimation:$dynamicanimation_version"
implementation 'com.plattysoft.leonids:LeonidsLib:1.3.2'
implementation 'com.ajts.androidmads.sqliteimpex:library:1.0.0'
implementation 'com.google.android.gms:play-services-ads:19.7.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.google.http-client:google-http-client-gson:1.26.0'
implementation('com.google.apis:google-api-services-drive:v3-rev136-1.25.0')
        {
            exclude group: 'org.apache.httpcomponents'
        }
}

I can see them both when searching all classes: enter image description here yet I still have no clue where the issue is coming from.

I'm relatively new to this so I may have missed some information. I can provide any other code or error information you may need.

Any input is appreciated, thanks!

Upvotes: 4

Views: 6474

Answers (1)

Nathan
Nathan

Reputation: 165

I have found the answer to this myself. It turns out it has to do with certain firebase implementations.

Google has created a package to counter this To solve this conflict, simply add this to your app-level build.gradle;

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

Upvotes: 9

Related Questions