找到一个包含谷歌AdMob依赖项之后"Duplicate class com.google.android.gms.common.api.internal.zza found in modules c



当我集成 Google Ad Mob 依赖项时,我得到了此错误implementation 'com.google.android.gms:play-services-ads:18.0.0'

项目级成绩:

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

模块级别分级:

apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.demo.something"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//Facebook account kit
implementation 'com.facebook.android:account-kit-sdk:4.39.0'
//sdp and ssp for dimension and font size
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
//Lottie Animation
implementation 'com.airbnb.android:lottie:2.8.0'
//Android Fast Networking for APIs
implementation 'com.amitshekhar.android:jackson-android-networking:1.0.2'
//Process Dialog
implementation 'com.wang.avi:library:2.1.3'
//Scratch Card
implementation 'com.github.myinnos:AndroidScratchCard:v1.0'
//Google AdMob
implementation 'com.google.android.gms:play-services-ads:17.0.0'
}
在模块类中找到重复

的类com.google.android.gms.common.api.internal.zza.jar(com.google.android.gms:play-services-base:11.8.0)和类.jar(com.google.android.gms:play-services-basement:16.0.1)

我已经在我的项目中检查了您的依赖项,并使用AndroidScratchCard捕获了其他错误。游戏服务没有问题。

您可以尝试重新生成项目。

相关内容

  • 没有找到相关文章

最新更新