7

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.

N-JOY
  • 10,344
  • 7
  • 51
  • 69
  • I am facing similar issues with MoPub. My requirement is very simple, add AdMob to the network of MoPub, and route all ad's through a campaign. If you try to create a new campaign, you will notice that a the campaign type can take 3 values. But the dropdown only shows 2. The missing one is Network. I hope they fix this, I am just 1 step closer from getting this working now. – Siddharth Aug 04 '12 at 02:29
  • i tried creating a campaign but it dint work for me. if you could successfully display ads in your app then please reply. – N-JOY Aug 04 '12 at 07:46
  • I am not able to display ads in my app (or the sample app). My intention is to link inmobi, admob and other networks thru mopub. Once I have this working I will start configuring specific types of ad's. I have sent MoPub a email, I hope they will respond and resolve the issue. – Siddharth Aug 04 '12 at 08:36
  • I am experiencing the same issue again. I tried MoPub a while back also and I had the same problem. – Eurig Jones Sep 21 '12 at 09:51
  • I am facing the same issue. Also my default demo ad is Running status on console. Did anyone found solution? – WonderSoftwares Jul 17 '17 at 07:19

1 Answers1

2

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).

Community
  • 1
  • 1
trooper
  • 4,444
  • 5
  • 32
  • 32