我在新的更新的稳定android studio中打开了旧的工作应用,选择运行应用选项时出现以下错误
程序类型已存在:com.google.ads.AdRequest$Gender
Message{kind=ERROR, text=Program type already present: com.google.ads.AdRequest$Gender, sources=[Unknown source file], tool name=Optional.of(D8)}
我仅更改为 build.gradle 文件,将其编译为实现字
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
}
答案 0 :(得分:-1)
糟糕,我不好。之所以出现该错误,是因为在lib文件夹中还显示了google ads旧的jar文件,并且还在gradle中添加了google ads。
只需删除以下行并解决。
implementation fileTree(include: ['*.jar'], dir: 'libs')