gpt4 book ai didi

java - 实现 'com.google.android.gms:play-services-ads:18.1.0'

转载 作者:行者123 更新时间:2023-12-02 02:46:56 24 4
gpt4 key购买 nike

我想向我的项目添加广告,但是当我添加下面的行时,它不起作用:

implementation 'com.google.android.gms:play-services-ads:18.1.0'

这些是来自 build.gradle 的依赖项:

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'com.google.android.gms:play-services-ads:18.1.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

最佳答案

您可能没有添加 Google Services Gradle Plugin到项目以及 google-services.json 文件(可以从 Firebase console 下载) - 因此您的应用程序无法进行身份验证。

com.google.android.gms.ads.APPLICATION_ID 添加到 AndroidManifest.xml 中具有相同的效果,因为 Play Services 插件添加了 google-services.json 在构建时。

...仅使用 AdMob 时,应首选第二个选项。

关于java - 实现 'com.google.android.gms:play-services-ads:18.1.0',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57137289/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com