0
votes

Previously my app launched in playstore but due to interstitial ads violated policy, ads turned off by google.

Now I'm again updating the app, removed the interstitial ads and using only banner ads. Created another app ids in admob and using them in project but the error showing "Ad failed to load"

I tried to use my other apps banner id also, but they are not working. i recreated the app with different package name but this also didnt solved my problem. i tried every combination. But I'm Not getting the result.

Code

JAVA.  
   setContentView(R.layout.activity_home);

        MobileAds.initialize(this, "ca-app-pub-2392231950998190~1823255001");

   AdView adview = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        adview.loadAd(adRequest);
        adview.setAdListener(new AdListener() {

            @Override
            public void onAdFailedToLoad(int errorCode) {
                Toast.makeText(getApplicationContext(), "Ad Failed to load", Toast.LENGTH_SHORT).show();
                // Code to be executed when an ad request fails.
            }

        });

MANIFEST :

    <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-2392231950998190~1823255001"/>

Logcat:-

07-19 21:26:23.097 1441-1452/? E/WakeGestureListener: cancelWakeUpTrigger
07-19 21:26:23.099 1441-1452/? E/WakeGestureListener: cancelWakeUpTriggerCANCELED
07-19 21:26:23.099 1441-1452/? E/WakeGestureListener: cancelWakeUpTrigger
07-19 21:26:23.099 1441-1452/? E/WindowManager: Cancel all lift to wake WakeUp
07-19 21:26:23.099 1441-1452/? E/WakeGestureListener: requestWakeUpTrigger
07-19 21:26:23.107 805-1906/? E/SSC_HAL: activate:50, [SSC_HAL] oem_sensor activate.
07-19 21:26:23.107 1441-1452/? E/WakeGestureListener: requestWakeUpTriggerREQUESTED
07-19 21:26:23.107 1441-1452/? E/WindowManager: lift to wake preEnable WakeUp
07-19 21:26:23.139 4376-4376/? E/RegisteredServicesCache: Next Tag=services
07-19 21:26:23.140 4376-4376/? E/RegisteredServicesCache: installedServices no uidString 
07-19 21:26:23.140 4376-4376/? E/RegisteredServicesCache: installedServices contains uidString : 10092
07-19 21:26:23.140 4376-4376/? E/RegisteredServicesCache: 1invalidateCache:WriteServiceStateToFile
07-19 21:26:23.140 4376-4376/? E/RegisteredServicesCache:  Writing service state Data Always
07-19 21:26:23.140 4376-4376/? E/RegisteredServicesCache: component namecom.google.android.apps.walletnfcrel/com.google.commerce.tapandpay.android.transit.tap.service.TransitHceService
07-19 21:26:23.140 4376-4376/? E/RegisteredServicesCache: component namecom.google.android.apps.walletnfcrel/com.google.commerce.tapandpay.android.hce.service.ValuableApduService
07-19 21:26:23.156 18607-18666/? E/PBSessionCacheImpl: sessionId[81836014808287019] not persisted.
07-19 21:26:23.209 16976-16976/? E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-19 21:26:23.209 16976-16976/? E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-19 21:26:23.252 30212-30243/? E/audio_route: Path: listen-cpe-handset-mic, length: 4
07-19 21:26:23.252 30212-30243/? E/audio_route:   id=0: ctl=MAD Input
07-19 21:26:23.252 30212-30243/? E/audio_route:     id=0 value=1
07-19 21:26:23.252 30212-30243/? E/audio_route:   id=1: ctl=MAD_SEL MUX
07-19 21:26:23.252 30212-30243/? E/audio_route:     id=0 value=0
07-19 21:26:23.252 30212-30243/? E/audio_route:   id=2: ctl=MAD_INP MUX
07-19 21:26:23.252 30212-30243/? E/audio_route:     id=0 value=0
07-19 21:26:23.252 30212-30243/? E/audio_route:   id=3: ctl=MAD_CPE1 Switch
07-19 21:26:23.252 30212-30243/? E/audio_route:     id=0 value=1
07-19 21:26:23.262 1441-1496/? E/libprocessgroup: Error encountered killing process cgroup uid 99804 pid 18077: No such file or directory
07-19 21:26:23.352 17214-17214/? E/adbd: failed to connect to socket 'localabstract:com.shrivishnukrishna.bsc': Connection refused
07-19 21:26:25.410 4376-4376/? E/RegisteredServicesCache: Next Tag=services
07-19 21:26:25.410 4376-4376/? E/RegisteredServicesCache: installedServices no uidString 
07-19 21:26:25.410 4376-4376/? E/RegisteredServicesCache: installedServices contains uidString : 10092
07-19 21:26:25.410 4376-4376/? E/RegisteredServicesCache: 1invalidateCache:WriteServiceStateToFile
07-19 21:26:25.410 4376-4376/? E/RegisteredServicesCache:  Writing service state Data Always
07-19 21:26:25.412 4376-4376/? E/RegisteredServicesCache: component namecom.google.android.apps.walletnfcrel/com.google.commerce.tapandpay.android.transit.tap.service.TransitHceService
07-19 21:26:25.412 4376-4376/? E/RegisteredServicesCache: component namecom.google.android.apps.walletnfcrel/com.google.commerce.tapandpay.android.hce.service.ValuableApduService
07-19 21:26:25.735 1441-3343/? E/ANDR-PERF-JNI: com_qualcomm_qtiperformance_native_perf_io_prefetch_start
07-19 21:26:25.736 815-815/? E/ANDR-IOP: IOP HAL: Received pkg_name = com.shrivishnukrishna.bsc pid = -1
07-19 21:26:25.739 815-874/? E/ANDR-IOP: io prefetch is disabled
07-19 21:26:25.798 1441-3343/? E/WakeGestureListener: cancelWakeUpTrigger
07-19 21:26:25.799 1441-3343/? E/WakeGestureListener: cancelWakeUpTriggerCANCELED
07-19 21:26:25.799 1441-3343/? E/WakeGestureListener: cancelWakeUpTrigger
07-19 21:26:25.799 1441-3343/? E/WindowManager: Cancel all lift to wake WakeUp
07-19 21:26:25.799 1441-3343/? E/WakeGestureListener: requestWakeUpTrigger
07-19 21:26:25.803 805-1906/? E/SSC_HAL: activate:50, [SSC_HAL] oem_sensor activate.
07-19 21:26:25.803 1441-3343/? E/WakeGestureListener: requestWakeUpTriggerREQUESTED
07-19 21:26:25.803 1441-3343/? E/WindowManager: lift to wake preEnable WakeUp
07-19 21:26:26.106 18255-18255/? E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-19 21:26:26.106 18255-18255/? E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-19 21:26:31.103 1441-3343/? E/ANDR-PERF-JNI: com_qualcomm_qtiperformance_native_perf_io_prefetch_start
07-19 21:26:31.103 815-815/? E/ANDR-IOP: IOP HAL: Received pkg_name = com.shrivishnukrishna.bsc pid = -1
07-19 21:26:31.105 815-874/? E/ANDR-IOP: io prefetch is disabled
07-19 21:26:31.120 1441-2938/? E/WakeGestureListener: cancelWakeUpTrigger
07-19 21:26:31.121 1441-2938/? E/WakeGestureListener: cancelWakeUpTriggerCANCELED
07-19 21:26:31.121 1441-2938/? E/WakeGestureListener: cancelWakeUpTrigger
07-19 21:26:31.121 1441-2938/? E/WindowManager: Cancel all lift to wake WakeUp
07-19 21:26:31.121 1441-2938/? E/WakeGestureListener: requestWakeUpTrigger
07-19 21:26:31.124 805-805/? E/SSC_HAL: activate:50, [SSC_HAL] oem_sensor activate.
07-19 21:26:31.125 1441-2938/? E/WakeGestureListener: requestWakeUpTriggerREQUESTED
07-19 21:26:31.125 1441-2938/? E/WindowManager: lift to wake preEnable WakeUp
07-19 21:26:31.421 18314-18314/? E/dboxed_process: Not starting debugger since process cannot load the jdwp agent.
07-19 21:26:31.804 18255-18255/com.shrivishnukrishna.bsc E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-19 21:26:31.804 18255-18255/com.shrivishnukrishna.bsc E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
2

2 Answers

1
votes

Were the ads being served earlier, before the app was taken down? Also, make sure you have added your payment info in Admob, otherwise ads will not be shown. Please note that, it may take up to a few hours depending on the location, for Admob to serve ads.

0
votes

Newly created ad units take time to get visible. This error is normal when ad is not available.

Test the app with demo ad id. If it is working then publish the app with the actual ad id. It will pop up after a while.