我在build.gradle中实现了play服务模块,现在我有了以下错误:
Duplicate class com.google.android.gms.measurement.internal.zzhg found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play- services-measurement-impl-20.0.2-runtime (com.google.android.gms:play-services-measurement-impl:20.0.2)我试着清理这个项目,但没有成功
这是我的build.gradle文件
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0-rc01'
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}发布于 2022-10-26 22:38:22
这是两个碰撞包的问题,
当包括2个谷歌播放服务包。它在截取对方。
所以用这条线;
implementation 'com.google.android.gms:play-services:10.2.4'你也可以用,
buildTypes {
release {
shrinkResources true
}
}https://stackoverflow.com/questions/72602699
复制相似问题