Ad did not load

349 views
Skip to first unread message

jiaqia...@woxiu.com

unread,
Sep 11, 2017, 4:52:50 AM9/11/17
to Google Mobile Ads SDK Developers
Hi,

I am new to Android development and I am trying to integrate AdMob into my app.i am using interstitial ads to display. it's not displaying the ad. i puted your sample appid(ca-app-pub-3940256099942544~3347511713) and appunitId(ca-app-pub-3940256099942544/1033173712) on my app, it's can display  ad is displaying. i puted my appid(ca-app-pub-7495491813684464~4849458816) and appunitId(ca-app-pub-7495491813684464/1156468269) on your sample app, it's can display. but when I puted my appid(ca-app-pub-7495491813684464~4849458816) and appunitId(ca-app-pub-7495491813684464/1156468269)  on my app  it's not displaying. It throws "Ad did not ad",

App ID: ca-app-pub-7495491813684464~4849458816
Ad unit name: Interstitial
Ad unit ID: ca-app-pub-7495491813684464/1156468269

I tried all ways but live ads not displaying. Please help me to solve the issue. i am clueless why it's not displaying. Struggling to display ads for more than a week.

Thanks.

private void initGoogleAds() {
MobileAds.initialize(getActivity(), Constants.ADMOB_APP_ID);
mInterstitialAd = new InterstitialAd(getActivity());
mInterstitialAd.setAdUnitId(Constants.ADMOB_AD_UNIT_ID);
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
startLoadAd();
}
});
startLoadAd();
}

private void startLoadAd() {
TelephonyManager tm = (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE);
deviceId = tm.getDeviceId();
Log.d("deviceIdTest", deviceId + "");

if (!mInterstitialAd.isLoading() && !mInterstitialAd.isLoaded()) {

AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(deviceId)
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
mInterstitialAd.loadAd(adRequest);
}
ivAdsText.setBackgroundResource(R.drawable.text_ad_gray);
ivAds.setBackgroundResource(R.drawable.sun_ad_gray);
if (mDrawable != null) {
mDrawable.stop();
}
resumeLoadAd(GAME_LENGTH_MILLISECONDS);
}
private void showInterstitial() {
// Show the ad if it's ready. Otherwise toast and restart the game.
if (mInterstitialAd != null && mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
} else {
Toast.makeText(getActivity()
, "Ad did not load", Toast.LENGTH_SHORT).show();
startLoadAd();
}
}


<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />

Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Sep 13, 2017, 2:19:54 PM9/13/17
to Google Mobile Ads SDK Developers
Hello, 

Thank you for providing the additional details. I was not able to load ads with your package name and Ad Unit ID. However, changing the package name worked fine and I was able to load the ads. It looks like there might be an issue with your package name. Can you try changing the package name and try loading the ads again? If that works, I'd suggest that you reach out to the AdMob Product Support Team by submitting this form, to get the issue resolved with your package name. Please make sure to login with your Gmail/AdMob account and provide them your Package name and Ad Unit ID so they can assist you further.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages