简体   繁体   中英

My Android app shows Admob interstitial Test ads but not real ads

My Android app shows Admob interstitial Test ads but not real ads . 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. ( Waited for 2 weeks still nothing ... ) and Test ads work perfectly fine.

i guess the problem is here in build.gradle app

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 . 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. use your original App Id and Ad Id only if you want to publish the app. make sure your Ad mod account does not have any sort of limit(like Account being assessed, Ad serving is limited).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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