跳转到内容

Error Handling

此内容尚不支持你的语言。

Your ad display delegate or callback interface receives a call if an ad fails to load or fails to display. This call is accompanied by an error code. This page describes these error codes.

Error Object

The error that you receive in your callback is a first-class error object that implements MaxError. This object has the following methods:

getCode()
Returns the error code, which you can find in the table below.
getMessage()
Returns a human-readable message that describes the error.
getMediatedNetworkErrorCode()
Returns the mediated network’s error code for the error. This is available only for errors returned in ad display failure callbacks.
getMediatedNetworkErrorMessage()
Returns the mediated network’s error message for the error. Defaults to an empty string. This is available only for errors returned in ad display failure callbacks.
getWaterfall()
Allows you to see information about the current waterfall for an ad. Network responses provide the ad load state, latency, credentials, and mediated network information for each ad in the waterfall. If an ad in the waterfall fails to load, the network response provides error information. You can find out more about this method in Advanced Settings: Waterfall Information API.

MAX Error Codes

CodeConstantDescriptionLoad / Display
204MaxErrorCode.NO_FILLNo ads are currently eligible for your device (no fill). MAX returned no eligible ads from any mediated networks for this app/device.L
−1MaxErrorCode.UNSPECIFIEDThe system is in an unexpected state. This state could not be categorized into one of the other defined errors. See the message field in the error object for more details.L/D
−23MaxErrorCode.FULLSCREEN_AD_ALREADY_SHOWINGYou are attempting to show a fullscreen ad (interstitial or rewarded) while another fullscreen ad was still showing.D
−24MaxErrorCode.FULLSCREEN_AD_NOT_READYYou are attempting to show a fullscreen ad before it has loaded.D
−1000MaxErrorCode.NETWORK_ERRORThe ad request failed due to a generic network error. See the message field in the error object for more details.L
−1001MaxErrorCode.NETWORK_TIMEOUTThe ad request timed out due to a slow internet connection.L
−1009MaxErrorCode.NO_NETWORKThe ad request failed because the device is not connected to the internet.L
−5001MaxErrorCode.AD_LOAD_FAILEDThe ad failed to load because no networks can fill. MAX returned eligible ads from mediated networks, but all ads failed to load. See the adLoadFailureInfo field in the error object for more details.L
−5201MaxErrorCode.ERROR_CODE_INVALID_LOAD_STATEThe internal state of the SDK is invalid. There are various ways this can occur.L
−5205MaxAdapterError.AD_NOT_READYThe adapter did not have an ad ready when attempting to display.L
−5209MaxAdapterError.INTERNAL_ERRORUnspecified internal error.L
−5601MaxErrorCode.NO_ACTIVITYThe SDK failed to load an ad because it could not find the top Activity.L
−5602MaxErrorCode.DONT_KEEP_ACTIVITIES_ENABLEDThe SDK failed to display an ad because the user has the “Don’t Keep Activities” developer setting enabled.D
−5603MaxErrorCode.INVALID_AD_UNIT_IDThe SDK failed to load an ad because the publisher provided an invalid ad unit identifier. Possible reasons:
  • ad unit identifier is malformed or does not exist
  • ad unit is disabled
  • ad unit is not associated with the current app’s package name
  • ad unit was created within the last 30–60 minutes
L

Error Codes from Various Networks

To better understand the error codes that various ad networks return, see the error documentation pages published by those networks: