Android Studio 重复类com.google.android.gms.测量.内部.zzhg

q7solyqu  于 2022-11-16  发布在  Android
关注(0)|答案(1)|浏览(138)

我在build.gradle中实现播放服务模块,现在遇到以下错误:

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
}
cvxl0en2

cvxl0en21#

这是两个碰撞包问题,
当包括2 Google Play服务包。它是拦截对方。
芳子用这句台词;

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

您还可以使用,

buildTypes {
   release {
     shrinkResources true
   }
}

相关问题