Google Ads Manager Test Ads always returns "No fill." error

572 views
Skip to first unread message

Brandon Pulley

unread,
Aug 7, 2023, 8:14:46 PM8/7/23
to Google Mobile Ads SDK Developers
Hello, I'm trying to load a sample native ad into my own app using the Google Ads SDK (`com.google.android.gms:play-services-ads:22.2.0`) but every attempt to load an ad results in the "No fill." error (error code 3).

When loading the sample app from the example repo (https://github.com/googleads/googleads-mobile-android-examples/tree/main/kotlin/admanager/NativeAdsExample) I am able to build the sample app, load the ad and display it. But when I try using the same sample credentials and same implementation in my own app, it always results in the "No fill." error.

Here is the setup in my own codebase, politely borrowed from the sample codebase above for testing purposes:

---------------- Android manifest file

    <application
        ...>

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

        <activity
            ....
            android:exported="true"
            android:launchMode="singleTask" ...

---------------- /manifest

------------------ MainActivity.kt
...
    private fun refreshAd() {
        val builder = AdLoader.Builder(this, "/6499/example/native")
        builder.forNativeAd { nativeAd ->
            // If this callback occurs after the activity is destroyed, you must call
            // destroy and return or you may get a memory leak.
            var activityDestroyed = false
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
                activityDestroyed = isDestroyed
            }
            if (activityDestroyed || isFinishing || isChangingConfigurations) {
                nativeAd.destroy()
                return@forNativeAd
            }
        }

        val videoOptions =
            VideoOptions.Builder().setStartMuted(false).build()

        val adOptions = NativeAdOptions.Builder().setVideoOptions(videoOptions).build()

        builder.withNativeAdOptions(adOptions)

        val adLoader =
            builder
                .withAdListener(
                    object : AdListener() {
                        override fun onAdFailedToLoad(loadAdError: LoadAdError) {
                            val error =
                                """"
            domain: ${loadAdError.domain}, code: ${loadAdError.code}, message: ${loadAdError.message}
          """
                            Toast.makeText(
                                this@MainActivity,
                                "Failed to load native ad with error $error",
                                Toast.LENGTH_SHORT
                            )
                                .show()
                        }
                    }
                )
                .build()

        adLoader.loadAd(AdManagerAdRequest.Builder().build())

    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        MobileAds.initialize(this) { }
        refreshAd()
        ...

------------------ /MainActivity.kt

I have also tried both setting my device to "test" mode and not setting my device to "test" mode, both with the same error noted above. Is there something I may have missed that would always result in a "No fill." error when loading the test ads?

Bitlejuce Do

unread,
Aug 10, 2023, 6:33:29 AM8/10/23
to Google Mobile Ads SDK Developers
Have the same issue. 

вторник, 8 августа 2023 г. в 02:14:46 UTC+2, Brandon Pulley:

Mobile Ads SDK Forum Advisor

unread,
Aug 10, 2023, 12:29:01 PM8/10/23
to bitl...@gmail.com, google-adm...@googlegroups.com
Hello,

Thank you for reporting this to us. Could you please try the following, then let us know how it goes?
  • Try using a different internet connection, then request an ad
  • Use our sample package name com.google.example.gms.nativeadvancedexample on your app
  • try to use our Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713
In addition, could you kindly share the following?
  • Your AdMob App ID
  • your app's package name 
This message is in relation to case "ref:_00D1U1174p._5004Q2nqYM3:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages