Testing and Troubleshooting

Retrieve the CreativeID

It may happen that some advertisers escape ad quality checks and end up compromising the user experience on the app by showcasing either an irrelevant, distasteful, or disrupting creative to the user. To combat such situations, you can retrieve the creativeID of the ad instance and report back to your InMobi point of contact with the encrypted creativeID. CreativeID is a property of IMBanner, IMInterstitial and IMNative object, which can be retrieved as follow:

public void onAdLoadSucceeded(@NonNull <inmobi_ad_object> ad, @NonNull AdMetaInfo info) { Log.d(TAG, “Creative ID for ad : “ + info.getCreativeID()); }</inmobi_ad_object>

Test Your Integration

You can start testing your integration by navigating to the Integration Tab on the InMobi Publisher Dashboard.

If you have Java and Python installed in your local system, click here and run the Library Detection Tool to ensure that all the mandatory libraries are needed for InMobi SDK integration [InMobi SDK, Picasso, browser, and RecyclerView] are available.

To set up a test device, you will need the corresponding device ID. The device id is the Google Play Advertising ID (GPID). To get the device ID, configure the SDK to print debug logs to the console.

Remember

You MUST turn off the test mode before going live or else your app will fail to monetize.
 

        3. If you have Java and Python installed in your local system, click here and run the Library Detection Tool to ensure that all the mandatory libraries needed for InMobi SDK integration [InMobi SDK, Picasso, browser, and RecyclerView] are available.


Get the Device ID

The device id is the Google Play Advertising ID (GPID). To get the device ID, configure the SDK to print debug logs to the console.

You can do so by adding the following line to your Activity where you are integrating InMobi ads.

InMobiSdk.setLogLevel(LogLevel.DEBUG);

The device ID will now be printed in debug logs in the DDMS console:


You will also get feedback on the diagnostics tab on the ad unit and ad request and this can be particularly helpful during integration. 


Helpful Debug Information

Once you have enabled debug logs as mentioned in step 1, SDK will print key logs to the DDMS console that provide useful information about the initialization and ad load lifecycle.

The following tables capture these logs.

SDK Initialization

Scenario

Log Level

Log message

Publisher passed a valid account id

Debug

InMobi SDK initialized with account id: <account id=""></account>

Publisher passed an invalid account Id

Debug

Invalid account id passed to init. Please provide a valid account id.

Publisher didn't grant the mandatory permissions

Debug

Please grant the mandatory permissions: INTERNET & ACCESS_NETWORK_STATE, SDK could not be initialized.

Permissions granted to the SDK

Debug

Permissions granted to the SDK are : <list granted="" of="" permissions=""></list>

Newer version of SDK is available

Debug

A newer version (ver. 9.0.0) of the InMobi SDK is available! You are currently on an older version (ver. 5.3.1). Download the latest InMobi SDK from http://www.inmobi.com/products/sdk/#downloads

 

Common Ad Lifecycle Messages

Scenario

Log Level

Log message

Ad requested when no network available

Error LogLevel

Network not reachable currently. Please try again.

Ad requested when ad state is loading or available

Error LogLevel

An ad load is already in progress. Please wait for the load to complete before requesting for another ad (Placement id: <placement id=""></placement>).

Ad requested when ad is viewed by user

Error LogLevel

An ad is currently being viewed by the user. Please wait for the user to close the ad before requesting for another ad (Placement id: <placement id=""></placement>).

Publisher device Id

Debug LogLevel

Publisher device id is <device id=""></device>

Requested ad being fetched from network

 

Ad will be fetched from network for the Placement Id - <placement id=""></placement>


Messages for Ad Integrations

Banner

Scenario

Log Level

Log message

Publisher called load on a banner

Debug

Fetching a Banner ad for placement id: <placement id=""></placement>

Successfully fetched ad

Debug

Banner ad successfully fetched for placement id: <placement id=""></placement>

Failed to fetch the ad

Debug

Failed to fetch Banner ad for placement id:<placement id=""></placement> with error: <status code="" message=""></status>

Started loading the banner in a webview

Debug

Started loading Banner ad markup in the webview for placement id: <placement id=""></placement>

Banner successfully loaded in the webview

Debug

Successfully loaded Banner ad markup in the webview for placement id: <placement id=""></placement>

Failed to load banner in the webview

Debug

NA

Banner refresh is initiated

Debug

Initiating Banner refresh for placement id: <placement id=""></placement>

invalid refresh interval

Debug

Refresh interval value supplied in XML layout is not valid. Falling back to default value.

Null Context

Error

Context supplied as null, the ad unit can't be created.

Layout params not set

Error

The layout params of the banner must be set before calling load

Height or width set to WRAP_CONTENT

Error

The height or width of a Banner ad can't be WRAP_CONTENT

Height or width not set

Error

The height or width of the banner cannot be determined

Null listener

Error

Please pass a non-null listener to the banner.

Interstitial

Scenario

Log Level

Log message

Publisher called load on interstitial

Debug

Fetching an interstitial ad for placement id: <placement id=""></placement>

Successfully fetched ad

Debug

Interstitial ad successfully fetched for placement id: <placement id=""></placement>

Failed to fetch the ad

Error

Failed to fetch interstitial ad for placement id:<placement id=""></placement> with error: <status code="" message=""></status>

Started loading the interstitial in a webview

Debug

Started loading interstitial ad markup in the webview for placement id: <placement id=""></placement>

Interstitial successfully loaded in the webview

Debug

Successfully loaded interstitial ad markup in the webview for placement id: <placement id=""></placement>

Failed to load interstitial in the webview

Error

Failed to load interstitial markup in the webview for placement id: <placement id=""></placement>

Failed to load interstitial in the webview due to timeout

Error

Failed to load the Interstitial markup in the webview due to time out for placement id: <placement id=""></placement>

Interstitial Ad displayed

Debug

Successfully displayed Interstitial for placement id:<placement id=""></placement>

Interstitial Ad dismissed

Debug

Interstitial ad dismissed for placement id:<placement id=""></placement>

No Listener specified Set Listener to null in constructor

Error

The Ad unit cannot be created as no event listener was supplied. Please attach a listener to proceed

Null context Set Context to null in constructor

Error

Unable to create ad unit with NULL context object

Ad show before ready Show ad before it's ready

Error

Ad Load is not complete. Please wait for the Ad to be in a ready state before calling show.

Rewarded Video

Scenario

Log Level

Log message

Publisher called load on interstitial

Debug

Fetching an interstitial ad for placement id: <placement id=""></placement>

Successfully fetched ad

Debug

Interstitial ad successfully fetched for placement id: <placement id=""></placement>

Failed to fetch the ad

Error

Failed to fetch interstitial ad for placement id:<placement id=""></placement> with error: <status code="" message=""></status>

Started loading the interstitial in a webview

Debug

Started loading interstitial ad markup in the webview for placement id: <placement id=""></placement>

Interstitial successfully loaded in the webview

Debug

Successfully loaded interstitial ad markup in the webview for placement id: <placement id=""></placement>

Failed to load interstitial in the webview

Error

Failed to load interstitial markup in the webview for placement id: <placement id=""></placement>

Failed to load interstitial in the webview due to timeout

Error

Failed to load interstitial markup in the webview due to timeout for placement id: <placement id=""></placement>

Interstitial Ad displayed

Debug

Successfully displayed Interstitial for placement id:<placement id=""></placement>

Interstitial Ad dismissed

Debug

Interstitial ad dismissed for placement id:<placement id=""></placement>

No Listener specified Set Listener to null in constructor

Error

The Ad unit cannot be created as no event listener was supplied. Please attach a listener to proceed

Null context Set Context to null in constructor

Error

Unable to create ad unit with NULL context object

Ad show before ready Show ad before it's ready

Error

Ad Load is not complete. Please wait for the Ad to be in a ready state before calling show The supplied resource id with show for animations is invalid

InMobiAdActivity not added

Error

Do not declare InMobiAdActivity in manifest file.

Native

Scenario

Log Level

Log Message

Publisher supplied a null context

Error

Unable to create InMobiNative ad with null Activity object

Publisher created a native ad without initializing the SDK

Error

Please initialize the SDK before creating a Native ad

Publisher created a native ad with an invalid placement id

Error

NA

Publisher supplies a null InMobiNativeAdListenerobject

Error

Listener supplied is null,the Native Ad cannot be created

Publisher called load on a native

Debug

Fetching a Native ad for placement id: <placement id=""></placement>

Ad is successfully fetched from server

Debug

Native ad successfully fetched for placement id: <placement id=""></placement>

Failed to fetch the ad

Error

Failed to fetch Native ad for placement id : <placement id=""></placement> with error : <status code="" message=""></status>

When AdView is inflated

Debug

Ad markup loaded into the container will be inflated into a View


In addition to logs printed by the SDK, you can also get feedback on the diagnostics tab on the ad unit and ad request, which can be particularly helpful during integration.  


Helpful Debug Information

Once you have enabled debug logs as mentioned in step 1, SDK will print key logs to the DDMS console that provide useful information about the initialization and ad load lifecycle.

The following tables capture these logs.

SDK Initialization

Scenario

Log Level

Log message

Publisher passed a valid account id

Debug

InMobi SDK initialized with account id: <account id=""></account>

Publisher passed an invalid account Id

Debug

Invalid account id passed to init. Please provide a valid account id.

Publisher didn't grant the mandatory permissions

Debug

Please grant the mandatory permissions: INTERNET & ACCESS_NETWORK_STATE, SDK could not be initialized.

Permissions granted to the SDK

Debug

Permissions granted to the SDK are : <list granted="" of="" permissions=""></list>

Newer version of SDK is available

Debug

A newer version (ver. 9.0.0) of the InMobi SDK is available! You are currently on an older version (ver. 5.3.1). Download the latest InMobi SDK from http://www.inmobi.com/products/sdk/#downloads

 

Common Ad Lifecycle Messages

Scenario

Log Level

Log message

Ad requested when no network available

Error LogLevel

Network not reachable currently. Please try again.

Ad requested when ad state is loading or available

Error LogLevel

An ad load is already in progress. Please wait for the load to complete before requesting for another ad (Placement id: <placement id=""></placement>).

Ad requested when ad is viewed by user

Error LogLevel

An ad is currently being viewed by the user. Please wait for the user to close the ad before requesting for another ad (Placement id: <placement id=""></placement>).

Publisher device Id

Debug LogLevel

Publisher device id is <device id=""></device>

Requested ad being fetched from network

 

Ad will be fetched from network for the Placement Id - <placement id=""></placement>


Messages for Ad Integrations

Banner

Scenario

Log Level

Log message

Publisher called load on a banner

Debug

Fetching a Banner ad for placement id: <placement id=""></placement>

Successfully fetched ad

Debug

Banner ad successfully fetched for placement id: <placement id=""></placement>

Failed to fetch the ad

Debug

Failed to fetch Banner ad for placement id:<placement id=""></placement> with error: <status code="" message=""></status>

Started loading the banner in a webview

Debug

Started loading Banner ad markup in the webview for placement id: <placement id=""></placement>

Banner successfully loaded in the webview

Debug

Successfully loaded Banner ad markup in the webview for placement id: <placement id=""></placement>

Failed to load banner in the webview

Debug

NA

Banner refresh is initiated

Debug

Initiating Banner refresh for placement id: <placement id=""></placement>

invalid refresh interval

Debug

Refresh interval value supplied in XML layout is not valid. Falling back to default value.

Null Context

Error

Context supplied as null, the ad unit can't be created.

Layout params not set

Error

The layout params of the banner must be set before calling load

Height or width set to WRAP_CONTENT

Error

The height or width of a Banner ad can't be WRAP_CONTENT

Height or width not set

Error

The height or width of the banner cannot be determined

Null listener

Error

Please pass a non-null listener to the banner.

Interstitial

Scenario

Log Level

Log message

Publisher called load on interstitial

Debug

Fetching an interstitial ad for placement id: <placement id=""></placement>

Successfully fetched ad

Debug

Interstitial ad successfully fetched for placement id: <placement id=""></placement>

Failed to fetch the ad

Error

Failed to fetch interstitial ad for placement id:<placement id=""></placement> with error: <status code="" message=""></status>

Started loading the interstitial in a webview

Debug

Started loading interstitial ad markup in the webview for placement id: <placement id=""></placement>

Interstitial successfully loaded in the webview

Debug

Successfully loaded interstitial ad markup in the webview for placement id: <placement id=""></placement>

Failed to load interstitial in the webview

Error

Failed to load interstitial markup in the webview for placement id: <placement id=""></placement>

Failed to load interstitial in the webview due to timeout

Error

Failed to load the Interstitial markup in the webview due to time out for placement id: <placement id=""></placement>

Interstitial Ad displayed

Debug

Successfully displayed Interstitial for placement id:<placement id=""></placement>

Interstitial Ad dismissed

Debug

Interstitial ad dismissed for placement id:<placement id=""></placement>

No Listener specified Set Listener to null in constructor

Error

The Ad unit cannot be created as no event listener was supplied. Please attach a listener to proceed

Null context Set Context to null in constructor

Error

Unable to create ad unit with NULL context object

Ad show before ready Show ad before it's ready

Error

Ad Load is not complete. Please wait for the Ad to be in a ready state before calling show.

Rewarded Video

Scenario

Log Level

Log message

Publisher called load on interstitial

Debug

Fetching an interstitial ad for placement id: <placement id=""></placement>

Successfully fetched ad

Debug

Interstitial ad successfully fetched for placement id: <placement id=""></placement>

Failed to fetch the ad

Error

Failed to fetch interstitial ad for placement id:<placement id=""></placement> with error: <status code="" message=""></status>

Started loading the interstitial in a webview

Debug

Started loading interstitial ad markup in the webview for placement id: <placement id=""></placement>

Interstitial successfully loaded in the webview

Debug

Successfully loaded interstitial ad markup in the webview for placement id: <placement id=""></placement>

Failed to load interstitial in the webview

Error

Failed to load interstitial markup in the webview for placement id: <placement id=""></placement>

Failed to load interstitial in the webview due to timeout

Error

Failed to load interstitial markup in the webview due to timeout for placement id: <placement id=""></placement>

Interstitial Ad displayed

Debug

Successfully displayed Interstitial for placement id:<placement id=""></placement>

Interstitial Ad dismissed

Debug

Interstitial ad dismissed for placement id:<placement id=""></placement>

No Listener specified Set Listener to null in constructor

Error

The Ad unit cannot be created as no event listener was supplied. Please attach a listener to proceed

Null context Set Context to null in constructor

Error

Unable to create ad unit with NULL context object

Ad show before ready Show ad before it's ready

Error

Ad Load is not complete. Please wait for the Ad to be in a ready state before calling show The supplied resource id with show for animations is invalid

InMobiAdActivity not added

Error

Do not declare InMobiAdActivity in manifest file.

Native

Scenario

Log Level

Log Message

Publisher supplied a null context

Error

Unable to create InMobiNative ad with null Activity object

Publisher created a native ad without initializing the SDK

Error

Please initialize the SDK before creating a Native ad

Publisher created a native ad with an invalid placement id

Error

NA

Publisher supplies a null InMobiNativeAdListenerobject

Error

Listener supplied is null,the Native Ad cannot be created

Publisher called load on a native

Debug

Fetching a Native ad for placement id: <placement id=""></placement>

Ad is successfully fetched from server

Debug

Native ad successfully fetched for placement id: <placement id=""></placement>

Failed to fetch the ad

Error

Failed to fetch Native ad for placement id : <placement id=""></placement> with error : <status code="" message=""></status>

When AdView is inflated

Debug

Ad markup loaded into the container will be inflated into a View


In addition to logs printed by the SDK, you can also get feedback on the diagnostics tab on the ad unit and ad request, which can be particularly helpful during integration.  

On This Page

Last Updated on: 01 Sep, 2021