程序类型已存在:com.google.android.gms.common.api.zzd,无法解析

Program type already present: com.google.android.gms.common.api.zzd , not able to resolve

我刚刚将 android studio 升级到 3.1.3 并创建了显示 admob 横幅广告的新项目,但出现此错误。

我在这个较新的版本[3.1.3]中打开了我的旧项目,我遇到了很多错误,但我通过在线搜索解决了它们。对于这个错误,我找不到任何东西。

以下是来自 build.gradle 文件的依赖项

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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:12.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'

}

谢谢。

已解决。 这是 build.gradle 中的问题,我对依赖项做了一些小改动

implementation "com.google.android.gms:play-services-gcm:15.0.1"

参考答案

如果您遇到此类问题,请检查您的依赖项及其版本。