Exactly the same problem.
Admob shows Test ads but not real ads
However I cant find any answer to be working.
- My app is published for 30 days, ads id is long enough for any wait process.
- I set no ppc cap/no limitation. There should be lots.
- Tried with the new ads ID. ( Waited for 1 week still nothing)
- Test ads work perfectly fine.
- No permission in manifest except the meta
Which permissions should i include when i use admob android - implementation 'com.google.android.gms:play-services-ads:18.2.0'
My guess,
1. something wrong with the 18.2.0 (Previously I failed to compile it using 18.1.0).
2. to include the permission in manifest as per old version.
Anyone to suggest working version of play services ads?
Edit 1: Adding code
TitleActivity.java
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
//Intent intent = new Intent(TitleActivity.this, AllTypes.class);
Intent intent = new Intent(TitleActivity.this, QuestionsActivity.class);
//Intent intent = new Intent(TitleActivity.this, bkMainActivity.class);
TitleActivity.this.startActivity(intent);
TitleActivity.this.finish();
}
}, delayTime);//1800
Log.d("Ads", "onInitializationComplete: Initialize complete");
}
});
AdsSystem.java
boolean useSampleID = false;
public void loadInterstitial(Context c){
//MobileAds.initialize(this,getString(R.string.app_ad_id));
mInterstitialAd = new InterstitialAd(c);
if (useSampleID){
mInterstitialAd.setAdUnitId(interstitialSampleID);
}else {
mInterstitialAd.setAdUnitId(String.valueOf(R.string.ad_interstitial_id));
}
//load
mInterstitialAd.loadAd(new AdRequest.Builder().build());
Log.d("Ads", "The interstitial is loading.");
}
public void showInterstitial(){
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
// Set an AdListener.
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed () {
AdRequest adRequest = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest);
Log.d("Ads", "The interstitial is loading.");
}
});
Log.d("Ads", "The interstitial is showing.");
} else {
Log.d("Ads", "The interstitial wasn't loaded yet.");
}
}
Will call load and show alternatively in MainActivity.
Edit 2 Added logcat from real device
2019-11-19 21:17:43.346 17702-17702/tk.myessentialoils.a16personalities
I/Ads: This request is sent from a test device.
2019-11-19 21:17:43.392 17702-17702/tk.myessentialoils.a16personalities
I/DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21001
2019-11-19 21:17:43.392 17702-17702/tk.myessentialoils.a16personalities I/DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 21001
2019-11-19 21:17:43.435 17702-17702/tk.myessentialoils.a16personalities D/Ads: The interstitial is loading.
2019-11-19 21:17:43.567 17702-17803/tk.myessentialoils.a16personalities W/Ads: Not retrying to fetch app settings
2019-11-19 21:17:45.111 2371-15333/? E/Ads: Cannot determine request type. Is your ad unit id correct?
2019-11-19 21:17:46.684 17702-17702/tk.myessentialoils.a16personalities I/Ads: Ad failed to load : 1