Do not load Admob test ads

1

I have a problem, a while ago I started to try the Rewarded test ads with Admob, everything went well! Now that I wanted to try the test ads again they do not come out, I even create a new project and implement only the Rewarded and it does not come out, but if I put an Interstitial it appears.

It always comes out: onRewardedVideoAdFailedToLoad

This is the code with the new project I did:

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        MobileAds.initialize(this, "ca-app-pub-3940256099942544~3347511713");

        // Use an activity context to get the rewarded video instance.
        mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this);
        mRewardedVideoAd.setRewardedVideoAdListener(this);
        loadRewardedVideoAd();
        if (mRewardedVideoAd.isLoaded()) {
            mRewardedVideoAd.show();
        }
        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });
    }

    private void loadRewardedVideoAd() {
        mRewardedVideoAd.loadAd("ca-app-pub-3940256099942544/5224354917",
                new AdRequest.Builder().build());
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onRewarded(RewardItem reward) {
        Toast.makeText(this, "onRewarded! currency: " + reward.getType() + "  amount: " +
                reward.getAmount(), Toast.LENGTH_SHORT).show();
        // Reward the user.
    }

    @Override
    public void onRewardedVideoAdLeftApplication() {
        Toast.makeText(this, "onRewardedVideoAdLeftApplication",
                Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoAdClosed() {
        Toast.makeText(this, "onRewardedVideoAdClosed", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoAdFailedToLoad(int errorCode) {
        Toast.makeText(this, "onRewardedVideoAdFailedToLoad", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoAdLoaded() {
        Toast.makeText(this, "onRewardedVideoAdLoaded", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoAdOpened() {
        Toast.makeText(this, "onRewardedVideoAdOpened", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoStarted() {
        Toast.makeText(this, "onRewardedVideoStarted", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoCompleted() {
        Toast.makeText(this, "onRewardedVideoCompleted", Toast.LENGTH_SHORT).show();
    }

I also added:

implementation 'com.google.android.gms:play-services-ads:15.0.1'

And then

maven {
        url "https://maven.google.com"
    }

And in the logcat I get this:

    06-08 19:17:06.525 2691-2691/android.cinemovil.xploit I/Ads: Starting ad request.
    This request is sent from a test device.
06-08 19:17:06.525 2691-2691/android.cinemovil.xploit W/Ads: Not retrying to fetch app settings
06-08 19:17:06.545 2691-2691/android.cinemovil.xploit I/Ads: Starting ad request.
    This request is sent from a test device.
06-08 19:17:06.585 2691-2691/android.cinemovil.xploit W/Ads: Not retrying to fetch app settings
06-08 19:17:16.985 2691-2714/android.cinemovil.xploit W/Ads: Fail to instantiate adapter com.google.DummyAdapter
    android.os.RemoteException
        at com.google.android.gms.internal.ads.zzxm.zzbp(Unknown Source)
        at com.google.android.gms.internal.ads.zzxm.zzbo(Unknown Source)
        at com.google.android.gms.internal.ads.zzxm.zzbm(Unknown Source)
        at com.google.android.gms.internal.ads.zzago.zzca(Unknown Source)
        at com.google.android.gms.internal.ads.zzahx.zzdn(Unknown Source)
        at com.google.android.gms.internal.ads.zzajy.run(Unknown Source)

I'm clear that I'm only using the Android Studio emulator. A couple of weeks ago I did everything the same and I got the test rewards videos without problem.

I do not know what to do ... I got to thinking if the Google test Rewards are failing, if someone can try to see if they work for them, because I'm not going.

    
asked by Luis Rivas 08.06.2018 в 04:14
source

1 answer

0

It is good to always add the message shown in the LogCat to determine the problem, in this case the error is defined as:

  

Ads: Failed to load ad: 3

You can check that the error is:

  

ERROR_CODE_NO_FILL : The ad request was successful, but   No ad was returned due to lack of inventory   ads.

Check that your App Id actually has ads set up.

    
answered by 08.06.2018 в 18:16