When trying test ads , getting onAdFailedToLoad with error code 3 - No ad config

1,002 views
Skip to first unread message

Liran Barsisa

unread,
Jul 26, 2020, 4:30:17 AM7/26/20
to google-adm...@googlegroups.com
```
    implementation 'com.google.android.gms:play-services-ads:19.3.0'
```

I want to avoid using real ads when on debug variant, always.

So I used to use the ad-unit of `ca-app-pub-3940256099942544/2247696110` when on debug, and it worked fine, just as on the sample of native ads.

Sadly, recently it stopped working, and keeps giving me this error 3 - " No ad config".

This happens even if I set the app ID to be as such in the manifest:

```
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-3940256099942544~3347511713" />
```

And even if I add the device to be a test device (as shown here) :

```kt
        if (BuildConfig.DEBUG)
            MobileAds.setRequestConfiguration(RequestConfiguration.Builder().setTestDeviceIds(listOf(...)).build())
```

Only if I use the real ad-unit and app-ID, it gets ads.
How come? 

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 27, 2020, 1:09:38 AM7/27/20
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi there,

Thank you for reaching out to us.

I tried our sample native advanced ad unit id, and I wasn't able to get the no fill error on my end. Instead, I was able to display an ad on my end (please see attached screenshot). With this, could you try the ad unit id again on your end? In addition, could you try loading an ad using a different internet connection? Also, could you try using our sample app, then let me know how it goes?

Regards,
Teejay Pimentel
Mobile Ads SDK Team

ref:_00D1U1174p._5004Q22ZACE:ref
device-2020-07-27-130503.png

Liran Barsisa

unread,
Jul 27, 2020, 2:26:06 AM7/27/20
to Google Mobile Ads SDK Developers
I didn't mention it clearly: The sample works fine.
Only on the real app, where we have both debug variant and release variant, I started getting the issue (on debug variant)
Using the test ad unit ids on the real app, it started recently to always fail.
Using real ad unit ids works on the real app, and I want to avoid it for debug variant.
I prefer not to add test devices, if possible. I have a check that if it's debug variant, just use the test ad unit ids.

BTW, something is wrong with this website's email notification mechanism.
I couldn't see any link to here. I had to find it myself, manually.
Please also avoid writing my name and email here. I have enough spammers already.

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 27, 2020, 6:07:02 AM7/27/20
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi Liran,

Could you kindly try our sample app id "ca-app-pub-3940256099942544~3347511713", and let me know if you're still seeing the behavior?

As an aside, I'm afraid that any concerns related to the AdMob SDK Help Forum itself is out-of-scope for our assistance. You may also want to keep in mind that your name and email are immediately visible in the forum whenever you post; this, again I'm afraid, is out of our control.

AD_LB

unread,
Jul 27, 2020, 6:49:57 AM7/27/20
to google-adm...@googlegroups.com
Hi,

As for the app id, I already tried it.
Meaning: I use this app-id, along with the test ad unit id : ca-app-pub-3940256099942544/2247696110 .
In fact I wrote it in the beginning of this thread.
And what I get is the error of :

onAdFailedToLoad: 3 - No ad config.

Tested on Pixel 4 R beta 2.5 , targetSdk is 28. But I also tried on Galaxy Note 8 with Android 8.

Also, please stop writing my name. Please remove it and let me know who to talk to about this privacy issue that can encourage spammers to send me emails.

Aman Kumar Raj

unread,
Jul 30, 2020, 7:09:35 AM7/30/20
to Google Mobile Ads SDK Developers
Hey AD_LB,Did your issue be resolved???
If yes,How did it get resolved dude?
Iam facing the same issue


Thanks You,
Aman

AD_LB

unread,
Jul 30, 2020, 7:28:21 AM7/30/20
to Google Mobile Ads SDK Developers
Somehow, it kinda solved by itself.
But, till it was solved, I used the real ad unit IDS, together with test-devices. This is the code I used:

if (BuildConfig.DEBUG) {
val deviceIds = arrayListOf(AdRequest.DEVICE_ID_EMULATOR)
getDeviceIdForAdMobTestAds(context)?.let { deviceIds.add(it.toUpperCase(Locale.ROOT)) }
MobileAds.setRequestConfiguration(RequestConfiguration.Builder().setTestDeviceIds(deviceIds).build())
}

And:

private fun getDeviceIdForAdMobTestAds(context: Context): String? {
val md5 = Settings.Secure.getString(context.contentResolver, Settings.Secure.ANDROID_ID)
try {
val md = MessageDigest.getInstance("MD5")
val array = md.digest(md5.toByteArray())
val sb = StringBuilder()
for (i in array.indices)
sb.append(Integer.toHexString(array[i].toInt() and 0xFF or 0x100).substring(1, 3))
return sb.toString()
} catch (e: NoSuchAlgorithmException) {
}
return null
}

I hope this always works. To me it looks like a big workaround. I found it somewhere about test-ids on StackOverflow.

After it started working by itself (meaning I used the test unit IDs instead of the real ones), I can avoid using the above code, if I wish.

AD_LB

unread,
Jul 30, 2020, 10:46:06 AM7/30/20
to Google Mobile Ads SDK Developers
Actually now I sometimes get this issue again. No idea why...
Happens for "ca-app-pub-3940256099942544/2247696110" (image alone), but not for "ca-app-pub-3940256099942544/1044960115" (with video)

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 30, 2020, 11:22:47 AM7/30/20
to lbl...@gmail.com, google-adm...@googlegroups.com
HI AB_LB,

Thank you for adding in the information that helped to fix it for you. We are glad it seems to be resolved for you.

Having looked over it, I do agree it seems like a lot of a workaround for this to work. And hopefully it will keep working for you.

If you should have any other issues in the future, please do not hesitate to ask us. We are always happy to help you.

Regards,
William Pescherine

vahidreza chitsaz

unread,
Jul 31, 2020, 10:01:57 PM7/31/20
to google-adm...@googlegroups.com
I have a somewhat similar issue. The ad is being loaded with test ad units but with real ad units (my release variant), the ad loading always fails and the LoadAdError always gives the message: "No ad config." 
I'm using 'com.google.android.gms:play-services-ads:19.3.0'
The issue is been around since the moment I tried to test it on real device with real ids. Instructions? is this is a bug with 19.3.0? I had worked with admob before and this is the first time I'm having issues. Other apps work fine with older versions. should I roll back?

AD_LB

unread,
Aug 1, 2020, 4:21:45 AM8/1/20
to Google Mobile Ads SDK Developers
Perhaps you didn't change the app-id on the manifest to be of your own app, instead of the one of the samples?

Jaewook Chun

unread,
Aug 3, 2020, 9:11:35 PM8/3/20
to Google Mobile Ads SDK Developers
According to "Ad Load Errors" (https://developers.google.com/admob/android/ad-load-errors?hl=en-US), the error code should tell us more. As for my case, the error code is 3, which is ERROR_CODE_NO_FILL (https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest#ERROR_CODE_NO_FILL). Perhaps there really was no ad available, and that's why it occasionally worked even though there was no change in the app.

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 4, 2020, 1:00:04 AM8/4/20
to sola...@gmail.com, google-adm...@googlegroups.com
Hi Jaewook,

I work along with Aryeh and William. 

Would it be possible for you to provide the following, for us to investigate the issue further?
  • Charles log (see instructions here) capturing the behavior
  • Sample project where the issue is reproducible
Kindly provide the requested details via Reply privately to author option.

Regards,
Teejay Pimentel

AD_LB

unread,
Aug 4, 2020, 4:13:44 AM8/4/20
to Google Mobile Ads SDK Developers
Why can't I send you? I still get this issue.
Please only via email though. I don't want to send things that might be sensitive.
Please let me know exactly what to send.

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 4, 2020, 6:35:59 AM8/4/20
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi Liran,

Kindly provide us a Charles log (see instructions here) capturing the behavior and a Sample project where the issue is reproducible. Please use the Reply privately to author option to send the details privately.

AD_LB

unread,
Aug 4, 2020, 2:01:22 PM8/4/20
to Google Mobile Ads SDK Developers
The instructions link doesn't work.
And I already tried in the past to use Charles app. It failed for me.
Is there perhaps an easier way to give you what you wish? Via Android Studio? adb? some Android app? Something to call on Admob SDK ?

BTW, I don't understand the email system here. Each time I don't get if you write on the forum or directly to me via email.
When writing on the forum, there used to be a link to the post. Now there isn't. I have to find it myself, manually.
Reply all
Reply to author
Forward
0 new messages