【问题标题】:Duplicate class com.google.android.gms.location.places.zza found发现重复的类 com.google.android.gms.location.places.zza
【发布时间】:2019-09-24 22:01:41
【问题描述】:

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


    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.

我该如何解决这个问题?

【问题讨论】:

    标签: android firebase google-cloud-firestore dependencies manifest


    【解决方案1】:

    移除以下依赖:

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

    来自docs

    注意:不要使用组合播放服务目标。它引入了数十个库,使您的应用程序膨胀。相反,请仅指定您的应用使用的特定 Google Play 服务 API。

    只使用特定的库,例如:

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

    【讨论】:

    • 我如何找到相关库
    • 您添加要在应用程序中使用的库
    • 你可以在这里找到库developers.google.com/android/guides/setup
    • 有同样的问题,但在我的项目中没有任何这一行。实施 'com.google.android.gms:play-services:11.4.0'
    猜你喜欢
    • 1970-01-01
    • 2019-07-28
    • 2019-03-27
    • 2021-01-18
    • 2019-05-31
    • 1970-01-01
    • 1970-01-01
    • 2016-09-23
    • 1970-01-01
    相关资源
    最近更新 更多