Admob : No fill from ad server - Failed to load ad: 3

4,361 views
Skip to first unread message

vhycko mayaut

unread,
Oct 28, 2014, 10:25:44 AM10/28/14
to google-adm...@googlegroups.com

Hallo, can someone help me?

My issue is that ads are not being displayed at all in my app, test mode or not. I am going to keep this question specific to test mode, and once I get that working I will worry about live ads.

Development Information

I am using Eclipse for development.

I have setup ads using Google Play Services and Admob in my Android app, as described in the online documentation provided by Google.

I have added my device ID using addTestDevice("xxxxxxxxxxxxxxxx"), and have checked the hashed device ID a number of times to be sure it is correct.

The Issue (see below for log info)

When I run the application on my device, no ads are displayed at all. This happens even when I have added my device as a test device.

I have searched high and low, and turned up many similar issues, but am yet to find an answer to this specific problem.

LogCat Output

10-28 13:56:41.659: I/Ads(1704): Starting ad request.
10-28 13:56:42.187: I/Ads(1704): No fill from ad server.
10-28 13:56:42.187: W/Ads(1704): Failed to load ad: 3
10-28 13:56:42.199: W/Ads(1704): No GMSG handler found for GMSG: gmsg://mobileads.google.com/jsLoaded?google.afma.Notify_dt=1414504602197

My Activity

M
package bb.hoppingbird;

import org.cocos2d.layers.CCScene;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.opengl.CCGLSurfaceView;

import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;

import android.app.Activity;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.v4.view.ViewPager.LayoutParams;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
import android.widget.RelativeLayout;
import android.widget.Toast;

public class MainActivity extends Activity {

private CCGLSurfaceView mGLSurfaceView;

//<!-- Admob Ads Using Google Play Services SDK -->
private static final String AD_UNIT_ID = "ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxx";
private static final String AD_INTERSTITIAL_UNIT_ID = "ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxx";


/** The Admob ad. */
private InterstitialAd interstitialAd = null;
public AdView adView = null;

public static MainActivity app;

public void onCreate(Bundle savedInstanceState)
{
    app
= this;

   
super.onCreate(savedInstanceState);

   
// set view
    mGLSurfaceView
= new CCGLSurfaceView(this);


   
//Ads ----------------
   
// Create the adView
   
RelativeLayout layout = new RelativeLayout(this);
    layout
.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

   
//<!-- Ads Using Google Play Services SDK -->
    adView
= new AdView(this);
    adView
.setAdSize(AdSize.SMART_BANNER);
    adView
.setAdUnitId(AD_UNIT_ID);

   
// Add the adView to it
   
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
           
LayoutParams.WRAP_CONTENT,
           
LayoutParams.WRAP_CONTENT);
   
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
   
params.addRule(RelativeLayout.CENTER_HORIZONTAL, RelativeLayout.TRUE);

    adView
.setLayoutParams(params);

    layout
.addView(mGLSurfaceView);
    layout
.addView(adView);

    setContentView
(layout);
   
//New AdRequest
   
AdRequest adRequest = new AdRequest.Builder()
   
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
   
.addTestDevice("0D47C6944503F0284666D16BB79BF684")
   
.build();

// Start loading the ad in the background.
adView
.loadAd(adRequest);


   
//-----------------------------------------------------Interstitial Add
   
// Create an Interstitial ad.
    interstitialAd
= new InterstitialAd(this);
    interstitialAd
.setAdUnitId(AD_INTERSTITIAL_UNIT_ID);
    interstitialAd
.setAdListener(new AdListener() {
         
@Override
         
public void onAdLoaded() {
            interstitialAd
.show();
         
}

         
@Override
         
public void onAdFailedToLoad(int errorCode) {
             
Toast.makeText(getApplicationContext(), "Interstitial Ads loading failed", Toast.LENGTH_SHORT).show();
         
}
   
});
     
// Load the interstitial ad.
   
//showInterstitialAds();

   
//----------------------
   
// set director
   
CCDirector director = CCDirector.sharedDirector();
    director
.attachInView(mGLSurfaceView);
    director
.setAnimationInterval(1/60);

   
// get display info
   
DisplayMetrics displayMetrics = new DisplayMetrics();
    getWindowManager
().getDefaultDisplay().getMetrics(displayMetrics);
    G
.display_w = displayMetrics.widthPixels;
    G
.display_h = displayMetrics.heightPixels;
    G
.scale = Math.max(G.display_w/1280.0f, G.display_h/800.0f);
    G
.width = G.display_w / G.scale;
    G
.height = G.display_h / G.scale;

   
// get data
   
SharedPreferences sp = CCDirector.sharedDirector().getActivity().getSharedPreferences("GameInfo", 0);
    G
.music = sp.getBoolean("music", true);
    G
.sound = sp.getBoolean("sound", true);

   
// create sound
    G
.soundMenu = MediaPlayer.create(this, R.raw.menu);
    G
.soundMenu.setLooping(true);
    G
.soundGame = MediaPlayer.create(this, R.raw.game);
    G
.soundGame.setLooping(true);
    G
.soundCollide = MediaPlayer.create(this, R.raw.collide);
    G
.soundJump = MediaPlayer.create(this, R.raw.jump);
    G
.soundLongJump = MediaPlayer.create(this, R.raw.long_jump);
    G
.soundSpeedDown = MediaPlayer.create(this, R.raw.speed_down);
    G
.soundSpeedUp = MediaPlayer.create(this, R.raw.speed_up);
    G
.soundDirection = MediaPlayer.create(this, R.raw.direction_sign);
    G
.soundClick = MediaPlayer.create(this, R.raw.menu_click);
    G
.soundCollect = MediaPlayer.create(this, R.raw.collect);
    G
.bgSound = G.soundMenu;

   
// show menu
   
CCScene scene = CCScene.node();
    scene
.addChild(new MenuLayer(true));
    director
.runWithScene(scene);
}  

@Override
public void onPause()
{
   
if (adView != null) {
          adView
.pause();
       
}

   
super.onPause();
    G
.bgSound.pause();
   
CCDirector.sharedDirector().onPause();
}

@Override
public void onResume()
{
   
super.onResume();

   
if (adView != null) {
        adView
.resume();
     
}

   
if( G.music ) G.bgSound.start();

   
CCDirector.sharedDirector().onResume();
}

@Override
public void onDestroy()
{
   
// Destroy the AdView.
   
if (adView != null) {
      adView
.destroy();
   
}

   
super.onDestroy();
    G
.bgSound.pause();
   
CCDirector.sharedDirector().end();
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
   
if( keyCode == KeyEvent.KEYCODE_BACK )
   
{
       
CCDirector.sharedDirector().onKeyDown(event);
       
return true;
   
}
   
return super.onKeyDown(keyCode, event);
}

public void showInterstitialAds()
{
    runOnUiThread
(new Runnable() {
       
public void run() {
             
AdRequest interstitialAdRequest = new AdRequest.Builder().build();
             interstitialAd
.loadAd(interstitialAdRequest);
       
}
   
});
}


Eric Leichtenschlag

unread,
Oct 28, 2014, 4:11:07 PM10/28/14
to google-adm...@googlegroups.com
Hello,

Your code here looks fine, and especially for test ads, I can't think of a reason for why you'd be getting no fill (which is error code 3).

Is there any chance you can proxy the ad request and provide the exact ad request url you're seeing? Alternatively, could you provide a .apk that I could use to generate this request url myself?

Thanks,
Eric
M

    interstitialAd
= new InterstitialAd</s
...

Luca Marzi

unread,
Dec 10, 2015, 4:35:57 PM12/10/15
to Google Mobile Ads SDK Developers
I'm having the same trouble and I can find a solution !
...

Dark Web

unread,
Dec 19, 2017, 12:41:27 AM12/19/17
to Google Mobile Ads SDK Developers
kindly let me know the solution of this hectic problem.
Reply all
Reply to author
Forward
0 new messages