如何解决我的Android应用显示了Admob插页式测试广告,但未显示真实广告
我的Android应用显示了Admob插页式测试广告,但没有显示真实广告。在发布此问题之前,我尝试了许多解决方案。但是我找不到任何答案。 我也尝试了新的广告ID。 (等了2周还是没事……) 和测试广告效果很好。
我想问题出在build.gradle应用
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.xxxxx.yyyyy"
minSdkVersion 18
targetSdkVersion 27
buildToolsVersion "27.0.0"
versionCode 1
versionName "2.0"
}
}
dependencies {
implementation fileTree(dir: 'libs',include: ['*.jar'])
implementation 'com.android.support:support-v4:27.0.0'
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
}
我试图迁移到AndroidX。仍然无法正常工作,并且有很多错误...
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.xxxxx.yyyyy"
minSdkVersion 18
targetSdkVersion 28
buildToolsVersion "28.0.3"
versionCode 1
versionName "2.0"
}
}
dependencies {
implementation fileTree(dir: 'libs',include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'com.google.android.gms:play-services-ads:19.5.0'
}
解决方法
将您的设备设置为测试设备。检查this以设置测试设备。 如果您使用的是仿真器,则已经将其设置为测试设备。 使用测试ID来测试广告。 仅当您要发布应用程序时,才使用原始的应用程序ID和广告ID。 确保您的Ad mod帐户没有任何限制(例如正在评估帐户,广告投放受到限制)。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。