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

时间:2019-05-07 09:11:58

标签: android dependencies manifest

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


    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.

我该如何解决?

1 个答案:

答案 0 :(得分:1)

删除以下依赖项:

custom:reports-access

来自docs

  

注意:请勿使用组合的播放服务目标。它带来了数十个库,使您的应用程序膨胀。而是仅指定您的应用使用的特定Google Play服务API。

仅使用特定的库,例如:

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