Skip to main content

Errors and troubleshooting

Where errors appear​

SourceHow it fails
Admob.initialize()Rejects, for example when the app ID is missing.
XxxAd.load()Rejects with the message "<code>: <message>" from the SDK, or the initialization error.
ad.show()Throws synchronously when the ad was already shown or has expired.
ad.onAdFailedToShowCalled with an AdmobError when presenting fails.
<BannerAd onAdFailedToLoad>Called with an AdmobError for each failed request.
AdPreloader onLoadErrorCalled with each rejection of its load function, before the retry.

AdmobError.code​

Platformcode
iOSThe numeric GADErrorCode, as a string.
AndroidThe SDK ErrorCode name.
Bothinitialization-failed when the SDK could not start (banners).

Because the codes differ per platform, branch on code per platform or log it rather than matching a single value.

Handling load failures​

try {
const ad = await InterstitialAd.load(adUnitId)
ad.show()
} catch (error) {
console.warn(error instanceof Error ? error.message : String(error))
}

No fill is normal, especially for new ad units. Prefer AdPreloader, which retries with backoff (5 seconds doubling up to 5 minutes), over retrying in a loop.

Troubleshooting​

SymptomCheck
initialize() rejects with "Add GADApplicationIdentifier…"The iOS app ID in Info.plist; see native setup.
initialize() rejects with "Add <meta-data …"The Android app ID in AndroidManifest.xml, inside <application>.
show() throws "This ad was already shown."Each ad shows once. Load a new one or use AdPreloader.
show() throws "This ad expired."The ad passed expiresAt (1 hour, app open 4 hours). Load a new one.
An adaptive banner never loadsIt needs a laid-out width greater than 0. Stretch it or give it a width.
No app open ad after returning to the appNone is ready yet, another full-screen ad is showing, minimumInterval has not passed, or it was a cold start.
nitro-ui prepare complains about nitro-coreAdd the overrides from installation.
Real ads on your own device during developmentUse Admob.testAdUnitId or add the device to testDeviceIds.