找到重复的 class com.google.android.gms.location.places.zza

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

这些是我在清单文件中的依赖项


    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"


我遇到错误

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.

我该如何解决这个问题?

删除以下依赖项:

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

来自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.

只使用特定的库,例如:

implementation 'com.google.android.gms:play-services-analytics:16.0.8'