找到重复的com.google.android.gms.location.places.zza类 [英] Duplicate class com.google.android.gms.location.places.zza found

查看:137
本文介绍了找到重复的com.google.android.gms.location.places.zza类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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"


我遇到错误

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'

来自文档


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

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'

这篇关于找到重复的com.google.android.gms.location.places.zza类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆