Skip to content

Android Error Codes

Overview

This document lists the error codes that may be returned by the UjuAd Android SDK and their meanings, helping developers quickly troubleshoot and resolve issues.

In the onLoadError and onAdError callbacks, developers receive a UjuException object and obtain error info via error.code and error.message. This document lists all possible error codes.

SDK Core Error Codes

The following error codes are defined in the ErrorType enum and are the core error codes exposed by the SDK:

CodeEnum NameMeaningPossible CauseSolution
0SUCCESSSuccessOperation successful-
1000UNKNOWNUnknown errorError caused by unknown reasonContact technical support and provide logs
1001INIT_ERRORInit failedWrong appId/appKey, network issue, config exceptionCheck if appId and appKey are correct, check network connection
1002CONFIG_ERRORConfig parameter errorUjuAdConfig or UjuAdInitConfig parameter missing or format errorCheck if config parameters are complete and correct
1003BIDDING_ERRORBidding errorAd bidding flow exceptionCheck ad placement config, confirm bidding strategy is correct
1004PERMISSION_DENIEDMissing required permissionAndroidManifest.xml missing required permission declarationsAdd INTERNET, ACCESS_NETWORK_STATE, and other permissions
1005PARAM_ERRORInvalid parameterInput validation failed, e.g., placementId is emptyCheck if input parameters are valid
1030NETWORK_ERRORNetwork connection exceptionNo network connection or network timeoutCheck network connection, retry later
2001LOAD_ERRORAd load failedNo ad fill, adapter exception, ad placement config errorCheck placement ID, confirm adapter is imported, retry later
2009SHOW_ERRORAd display failedCalled show before ad loaded successfully, wrong stateEnsure show is called after onLoadSuccess, check isReady()
2010TIMEOUTOperation timeoutAd request or load timeoutCheck network condition, appropriately increase timeout or retry
2011NOT_FIND_ADAPTERAdapter not foundAdapter for the corresponding ad network not importedCheck if build.gradle imports the corresponding ADN adapter dependency

ADX Self-Owned Ad Source Error Code Segments

The SDK internal ADX self-owned ad sources use independent error code segments, defined in AdxErrorEnums:

Code SegmentCategoryDescription
0SuccessADX request successful
1xxxData relatedData parsing, data format, and other errors
2xxxVideo relatedVideo creative loading, playback, and other errors
3xxxImage relatedImage creative loading, rendering, and other errors
4xxxNetwork relatedADX network request, connection, and other errors
5xxxReporting relatedEvent reporting, tracking, and other errors
6xxxDeeplink relatedDeep link jump errors
9xxxGeneral errorsOther uncategorized errors

Error Handling Best Practices

1. Distinguish onLoadError and onAdError

  • onLoadError(error: UjuException, placementId: String): Ad load phase failure, common error codes 1001/1002/1003/1030/2001/2011
  • onAdError(error: UjuException): Ad display phase failure, common error codes 2009/2010

2. Error Log Recording

kotlin
override fun onLoadError(error: UjuException, placementId: String) {
    // Record error code, error message, and placement ID for troubleshooting
    Log.e("UjuAd", "Load failed: code=${error.code}, msg=${error.message}, pid=$placementId")
}

override fun onAdError(error: UjuException) {
    // Record display phase errors
    Log.e("UjuAd", "Show failed: code=${error.code}, msg=${error.message}")
}

3. Retry Mechanism

  • For network errors (1030) and timeouts (2010), implement a reasonable retry mechanism
  • Set retry interval and max retry count to avoid infinite retries
  • Recommended retry interval 3-5 seconds, max 3 retries

4. Common Issue Troubleshooting

SymptomPossible Error CodeTroubleshooting Direction
SDK init failed1001Check if appId/appKey/channel are correct
Ad not loading2001/2011Check placement ID, whether adapter dependency is imported
Ad not displaying2009Confirm show is called after onLoadSuccess, check isReady()
No fill2001Normal phenomenon, insufficient ad inventory, retry later
Network error1030Check network connection
Permission error1004Check AndroidManifest.xml permission declarations

Contact Technical Support

If you encounter unsolvable error issues, you can contact technical support via:

  • Email: marco@ujuad.com
  • Ticket: Submit a ticket in the UjuAd developer backend
  • Online Support: Contact online support via the official website

Providing the error code, error message, environment, and reproduction steps helps technical support locate and resolve issues faster.