发现重复的类 com.google.android.gms.location.places.zza

Duplicate class com.google.android.gms.location.places.zza found(发现重复的类 com.google.android.gms.location.places.zza)

本文介绍了发现重复的类 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.

我该如何解决这个问题?

How can I fix this?

推荐答案

移除以下依赖:

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:发现重复的类 com.google.android.gms.location.places.zza

基础教程推荐