Android

This document outlines common errors encountered during Android SDK implementation, along with their causes and solutions. It aims to help developers troubleshoot issues quickly and ensure seamless integration.

1. Errors in oncmpError callback

One of the callbacks within ChoiceCMPCallback is onCmpError, which gets fired whenever there’s an issue in CMP. This function has a parameter: error which contains information about the error that has occurred.

Here’s a list of error messages that error can have:

Message Possible Reasons Actions
No connection found to load CMP There is no internet connection on the device. Check internet connection on the device. Make sure the app is given permission to use the network.
Given pCode is invalid The PCode is invalid. Look for any spaces. Make sure the PCode is copied from the portal without the “p-”.
Could not find configuration for this packageId. Have you set it up in InMobi Choice web portal? The combination of pcode and packageId is not found on the portal. Either pcode or packageId is invalid. Check pcode and packageId provided during initialization. Check the spaces in packageId. Make sure packageId is a valid entry in portal.
SDK must be initialized first by calling startChoice method Trying to call cmp api before initializing sdk.   Initialise SDK first by calling startChoice method. Wait for the onCmpLoaded callback before calling any API.
An error has occurred when CMP tried to execute a network call Some exception occured while doing a network call. If the issue persists, contact InMobi
An invalid json format has been found when CMP tried to read the data There is some issue with the json response format returned after doing a network call. If the issue persists, contact InMobi
Couldn't load publisher logo, url is empty or it doesn't return an image The logo on the GDPR screen was not loaded. Either the URL was empty or there was no image on the given URL. If the logo is to be displayed on the GDPR consent screen, make sure the image URL on the portal is not empty and the URL is valid.
An error has occurred when a TCModel property was tried to be set There was some error while setting TCModel property. Make sure cmp is initialized properly. If the issue persists, contact InMobi.
An unexpected value was received from GeoIp service Occurs while setting default CCPA consent. Value received for location from geoip is invalid. If the issue persists, contact InMobi.
An unexpected error has occurred when CMP tried to do a network call Unknown exception occured while trying to do a network call. Some unknown exception occurred during network call. If the issue persists, contact InMobi.
CFileNotFoundException has been captured when CMP tried to do a network call FileNotFound Exception occured while trying to do a network call. If the issue persists, contact InMobi
An invalid URL has been passed The URL passed to the privacy policy link of the GDPR screen is invalid Make sure that the URL given for the privacy policy link under the GDPR section is valid, check for spaces in the field.
Some error occurred while saving consent There was some issue in saving MSPA consent. If the issue persists, contact InMobi
Init screen texts are missing Some screen texts are missing and not configured properly on the portal. Check all the fields are filled and saved properly on the portal.

 2. Errors that appear in console

Debug and Error Logs are logged in the console to track any misbehavior or errors in SDK. Here's a list of Error Logs and their description:

Message Possible Reasons Actions
The value is too large to be encode into the number of bits passed Internal system behaviour related log caused due to long encoding failure Report to InMobi
Invalid bit length Internal system behaviour related log caused due to decoding failure Report to InMobi
Some unknown error occurred Some unknown error occurred while saving MSPA consent. Check the network connection and try again. If the issue still persists, contact InMobi.
Some error occurred while saving consent There was some error while saving MSPA consent. Check the network connection and try again. If the issue still persists, contact InMobi.

3. Info messages that appear in console

Info messages are logged in console to convey meaningful messages in SDK. Here is a list of those messages and description:

Message Possible Reasons
Either US Privacy is not applicable or disabled for the current location Either US privacy is not applicable for current region or is disabled from portal.
This consent is not available for the given country Regulation applied is not valid for the current country.
GDPR is not applicable for this scenario Either GDPR is not applicable for current country or is disabled from portal.
Either GBC is not applicable or disabled for the current location GBC is not applicable for current region or is disabled from portal.
Auto pop-up is disabled and not applicable for this region because CCPA is enabled for this region Auto pop-up is disabled and will not be applicable even if enabled as CCPA is applicable for this region. Auto pop-up is shown if MSPA/GDPR is applicable.
Auto pop-up is not applicable for this region as CCPA is enabled CCPA is applicable for the current region so auto pop up will not be displayed. Auto pop-up is shown if MSPA/GDPR is applicable.
Auto pop-up is disabled so no dialog will be shown MSPA auto pop-up is disabled from the portal so no dialog will be shown automatically.
MSPA is applicable but no need to re-trigger the screen MSPA is applicable and consent is present

On This Page

Last Updated on: 20 Jan, 2025