Google AdMob ad error: failed to
load
If You have seen error like this and code is as shown below:
// Define add below as
banner
AdView mAdView = new AdView(SplashActivity.this);
mAdView.setAdUnitId(getResources().getString(‘YOUR AD UNIT ID’));
mAdView.setAdSize(AdSize.BANNER);
RelativeLayout layout = (RelativeLayout) findViewById(R.id.splash_layout);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
layout.addView(mAdView, params);
mAdView.loadAd(new AdRequest.Builder().build());
AdView mAdView = new AdView(SplashActivity.this);
mAdView.setAdUnitId(getResources().getString(‘YOUR AD UNIT ID’));
mAdView.setAdSize(AdSize.BANNER);
RelativeLayout layout = (RelativeLayout) findViewById(R.id.splash_layout);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
layout.addView(mAdView, params);
mAdView.loadAd(new AdRequest.Builder().build());
If there is no mistakes found in your code then you should not worry.
If you have created your AdMob account recently then you should wait for 1 or 2 days. After 1 or 2 days, Your ad will works fine.
Important Notice: If you are new to AdMob then Please remember that do not click on ads while testing. If you are doing your AdMob Account will be deleted.
No comments:
Post a Comment