Ad not loaded on android

My application integrates Mopub Ads sdk. I created an account on Mopub and got AdUnitId for my application.

I followed all the steps mentioned in the mopub tutorial, although the steps were very simple, I was not able to show ads in my application. I always get the following logs:

D/MoPub(2393): MoPub server returned invalid response. I/MoPub(2393): Ad failed to load. 

Here is my code to download the banner ad:

 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 have not added payment data to the Mopub server yet. Could this be a likely cause. But I think that the payment data has nothing to do with the above exception.

Any help would be appreciated.

+7
source share
1 answer

The code to download your banner looks great. Payment details should not affect anything. The first installation of AdUnit should automatically include a "demo campaign" that will serve as the "It worked" ad. Go to Campaigns on MoPub and confirm that it exists and is enabled for your AdUnit.

Regarding the error:

D / MoPub (2393): the MoPub server responded with an incorrect answer.

I / MoPub (2393): Ad not loaded.

I recently encountered this during testing - so far I have noticed that this is happening with API8. All other versions that I tested successfully completed a demo ad.

Try testing a different version (if you find what is happening here, add it to this answer).

+2
source

All Articles