Our SDKs return errors as integer codes, but to make this more manageable, we've provided a set of named constants that correspond to these codes. (ex. public static final int NO_FILL = 204). This gives you the flexibility to check for errors using the named constants. Here is an Android example:
public void failedToReceiveAd(int errorCode) {
if(errorCode == AppLovinErrorCodes.NO_FILL){
// Indicates that no ads are currently eligible for your device & location.
}
else{
// Unable to reach AppLovin; the user's device is likely experiencing poor connectivity.
}
}
If you are checking for the specific error returned, we recommend using these named constants vs. the integers in your code. You can find out more about our error codes here and in AppLovinErrorCodes.
public static final int FETCH_AD_TIMEOUT = -102;
- Indicates that the network conditions prevented the SDK from receiving an ad.
public static final int NO_NETWORK = -103;
- Indicates that the device had no network connectivity at the time of an ad request, either due to airplane mode or no service
public static final int ERROR_CODE_IO_EXCEPTION = -100;
- General IO exception. Should not ever happen, but safe to treat like a 204
public static final int NO_FILL = 204;
- Indicates that no ads are currently eligible for your device.
public static final int UNABLE_TO_RENDER_AD = -6;
- Indicates that there has been a failure to render an ad on screen.
public static final int UNSPECIFIED_ERROR = -1;
- Indicates that the system is in an unexpected state.
public static final int UNABLE_TO_PREPARE_NATIVE_AD = -700;
- Indicates that there was an error while attempting to render a native ad.
public static final int UNABLE_TO_PRECACHE_RESOURCES = -200;
- Indicates that an attempt to cache a resource to the filesystem failed; the device may be out of space.
public static final int UNABLE_TO_PRECACHE_IMAGE_RESOURCES = -201;
- Indicates that an attempt to cache an image resource to the filesystem failed; the device may be out of space.
public static final int UNABLE_TO_PRECACHE_VIDEO_RESOURCES = -202;
- Indicates that an attempt to cache a video resource to the filesystem failed; the device may be out of space.
Rewarded Videos:
public static final int INCENTIVIZED_NO_AD_PRELOADED = -300;
- Indicates that the developer called for a rewarded video before one was available. Note: This code is only possible when working with rewarded videos.
public static final int INCENTIVIZED_UNKNOWN_SERVER_ERROR = -400;
- Indicates that an unknown server-side error occurred. Note: This code is only possible when working with rewarded videos.
public static final int INCENTIVIZED_SERVER_TIMEOUT = -500;
- Indicates that a reward validation requested timed out (usually due to poor connectivity). Note: This code is only possible when working with rewarded videos.
public static final int INCENTIVIZED_USER_CLOSED_VIDEO = -600;
- Indicates that the user exited out of the ad early. You may or may not wish to grant a reward depending on your preference. Note: This code is only possible when working with rewarded ads.
public static final int INVALID_URL = -900;
- Indicates that a postback URL you attempted to dispatch was empty or nil.