简体   繁体   English

我的 Android 应用显示 Admob 插页式测试广告但不显示真实广告

[英]My Android app shows Admob interstitial Test ads but not real ads

My Android app shows Admob interstitial Test ads but not real ads .我的 Android 应用程序显示 Admob 插页式测试广告,但不显示真实广告。 i tried many solutions before posting this question.在发布这个问题之前,我尝试了很多解决方案。 but i cant find any answer to be working.但我找不到任何工作的答案。 also i tried with the new ads ID.我也尝试使用新的广告 ID。 ( Waited for 2 weeks still nothing ... ) and Test ads work perfectly fine. (等了 2 周还是一无所获……)并且测试广告效果很好。

i guess the problem is here in build.gradle app我想问题出在 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'

}

i tried to migrate to AndroidX .我试图迁移到 AndroidX 。 still not working and many errors ...仍然无法正常工作,并且出现许多错误...

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'

}

setup your device as a test device.将您的设备设置为测试设备。 check this to setup a test device.检查此项以设置测试设备。 if you are using emulator it is already set as a test device.如果您使用的是模拟器,它已经被设置为测试设备。 use test id to test Ads.使用测试 ID 来测试广告。 use your original App Id and Ad Id only if you want to publish the app.仅当您要发布应用程序时,才使用您的原始应用程序 ID 和广告 ID。 make sure your Ad mod account does not have any sort of limit(like Account being assessed, Ad serving is limited).确保您的 Ad mod 帐户没有任何限制(例如正在评估的帐户,广告投放受到限制)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM