Ad load errors
Stay organized with collections
Save and categorize content based on your preferences.
In cases where an ad fails to load, a
callback
is called which provides a
LoadAdError
object.
The following example shows the information available when an ad fails to load:
Kotlin
override fun onAdFailedToLoad(adError: LoadAdError) {
// Gets the error code. See
// https://developers.google.com/admob/android/early-access/nextgen/reference/com/google/android/libraries/ads/mobile/sdk/common/LoadAdError.ErrorCode
// for a list of possible codes.
val errorCode = adError.code
// Gets an error message.
val errorMessage = adError.message
// Gets additional response information about the request. See
// https://developers.google.com/ad-manager/mobile-ads-sdk/android/early-access/nextgen/response-info
// for more information.
val responseInfo = adError.responseInfo
// All of this information is available using the error's toString() method.
Log.d("Ads", adError.toString())
}
Java
@Override
public void onAdFailedToLoad(@NonNull LoadAdError adError) {
// Gets the error code. See
// https://developers.google.com/admob/android/early-access/nextgen/reference/com/google/android/libraries/ads/mobile/sdk/common/LoadAdError.ErrorCode
// for a list of possible codes.
ErrorCode errorCode = adError.getCode();
// Gets an error message.
String errorMessage = adError.getMessage();
// Gets additional response information about the request. See
// https://developers.google.com/ad-manager/mobile-ads-sdk/android/early-access/nextgen/response-info
// for more information.
ResponseInfo responseInfo = adError.getResponseInfo();
// All of this information is available using the error's toString() method.
Log.d("Ads", adError.toString());
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eWhen an ad fails to load, a callback function is triggered, providing a \u003ccode\u003eLoadAdError\u003c/code\u003e object for detailed information.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLoadAdError\u003c/code\u003e object contains an error code, which can be used to determine the specific issue encountered during the ad loading process.\u003c/p\u003e\n"],["\u003cp\u003eThis object also provides an error message and response information, offering more context about the failed ad request.\u003c/p\u003e\n"],["\u003cp\u003eAll available information regarding the ad loading error, including the code, message, and response info, can be accessed using the error's \u003ccode\u003etoString()\u003c/code\u003e method.\u003c/p\u003e\n"]]],[],null,["In cases where an ad fails to load, a\ncallback\nis called which provides a\n`LoadAdError` object.\n\nThe following example shows the information available when an ad fails to load: \n\nKotlin \n\n override fun onAdFailedToLoad(adError: LoadAdError) {\n // Gets the error code. See\n // https://developers.google.com/admob/android/early-access/nextgen/reference/com/google/android/libraries/ads/mobile/sdk/common/LoadAdError.ErrorCode\n // for a list of possible codes.\n val errorCode = adError.code\n // Gets an error message.\n val errorMessage = adError.message\n // Gets additional response information about the request. See\n // https://developers.google.com/ad-manager/mobile-ads-sdk/android/early-access/nextgen/response-info\n // for more information.\n val responseInfo = adError.responseInfo\n // All of this information is available using the error's toString() method.\n Log.d(\"Ads\", adError.toString())\n }\n\nJava \n\n @Override\n public void onAdFailedToLoad(@NonNull LoadAdError adError) {\n // Gets the error code. See\n // https://developers.google.com/admob/android/early-access/nextgen/reference/com/google/android/libraries/ads/mobile/sdk/common/LoadAdError.ErrorCode\n // for a list of possible codes.\n ErrorCode errorCode = adError.getCode();\n // Gets an error message.\n String errorMessage = adError.getMessage();\n // Gets additional response information about the request. See\n // https://developers.google.com/ad-manager/mobile-ads-sdk/android/early-access/nextgen/response-info\n // for more information.\n ResponseInfo responseInfo = adError.getResponseInfo();\n // All of this information is available using the error's toString() method.\n Log.d(\"Ads\", adError.toString());\n }"]]