Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ad failed to load in android

Tags:

android

ads

mopub

I have integrated Mopub Ads sdk in my application. I have created an account at Mopub and got an AdUnitId for my aplication.

I have followed all the steps mentioned in the mopub tutorial, though steps were very simple, i failed to display ads in my application. I always keep getting the following logs:

D/MoPub(2393): MoPub server returned invalid response.

I/MoPub(2393): Ad failed to load.

Here is my code for fetching Ad banner:

MoPubView mAdView = (MoPubView) findViewById(R.id.adview);
        mAdView.setAdUnitId("xxxxxxxxxxxxxx"); 
        mAdView.loadAd();
        mAdView.setOnAdLoadedListener(new OnAdLoadedListener() {
            public void OnAdLoaded(MoPubView mpv) {
                Toast.makeText(getApplicationContext(), "Ad loaded!!!", Toast.LENGTH_SHORT).show();
            }
        });

Note: I havent added payment details on Mopub server yet. Can this be the probable reason. But i think payment details has nothing to do with the above mentioned exception.

Any help would be appreciated.

like image 918
N-JOY Avatar asked Jul 04 '12 06:07

N-JOY


People also ask

How to fix AdMob error code 3?

Google throws error code 3 for many reasons. One of the official reason is that there is no Ads in the Google Server. This Error is also caused when you change your Keystore after implementing the Ad to previous Keystore. If you have changed your Keystore then you can fix this error just by replacing the Ad Unit.

Why is AdMob not showing ads?

Ads won't show if you haven't integrated the Google Mobile Ads SDK correctly. Is your ad implementation code working properly? Test your implementation code to check that ads can show. You can also use ad inspector to test your app's ad serving.

How do I put ads on my Android?

To configure your app to carry ads, you must integrate an Google Play Instant-compatible ad-network SDK into your app. The Google Mobile Ads Lite SDK is one such SDK. For more information about integrating an ad-network SDK, see the guides related to Google Mobile Ads Lite SDK and Google AdMob.

Why can't I view ads on my phone?

MOBILE ADS TROUBLESHOOTING Ensure you don't have too many apps running in the background. Check to see if there are any privacy settings/settings on your device that restrict you from viewing ads. Check that your Internet provider/region does not restrict ads, or your modem/provider doesn't throttle ads or ad content.


Video Answer


1 Answers

The code for fetching your banner looks fine. The payment details should not affect anything. The first AdUnit you setup should automatically include a 'demo campaign' that will serve a 'It Worked' ad. Goto 'Campaigns' on the MoPub site and confirm that this exists and is enabled for your AdUnit.

As for the error:

D/MoPub(2393): MoPub server returned invalid response.

I/MoPub(2393): Ad failed to load.

I recently encountered this during testing - so far I have only noticed it happening with API8. All other versions I have tested have successfully served the demo ad.

Try testing against another version (if you discover what is going on here please append it to this answer).

like image 170
trooper Avatar answered Oct 09 '22 18:10

trooper