Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate class com.google.android.gms.location.places.zza found

These are my dependencies in manifest file


    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.android.gms:play-services:11.4.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.firebase:firebase-firestore:18.0.0'
    implementation "com.google.android.libraries.places:places:1.1.0"


I am getting error

Duplicate class com.google.android.gms.location.places.zza found in modules classes.jar (com.google.android.gms:play-services-places-placereport:16.0.0) and classes.jar (com.google.android.gms:play-services-places:11.4.0)

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

How can I fix this?

like image 589
shayanmalinda Avatar asked May 07 '19 09:05

shayanmalinda


1 Answers

Remove the following dependency:

implementation 'com.google.android.gms:play-services:11.4.0'

From the docs:

Note: Don't use the combined play-services target. It brings in dozens of libraries, bloating your application. Instead, specify only the specific Google Play services APIs your app uses.

Only use specific libraries, example:

implementation 'com.google.android.gms:play-services-analytics:16.0.8'
like image 148
Peter Haddad Avatar answered Nov 01 '22 11:11

Peter Haddad