Help! InMobi problems.

So I’ve been trying to implement in mobi over the last day or two but I just cant get it working.  The code is simple:

build.settings important bits:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", "portraitUpsideDown" } }, android = { versionCode = "10", largeHeap = true, usesPermissions = { "com.android.vending.BILLING", "android.permission.INTERNET", "android.permission.READ\_PHONE\_STATE", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.ACCESS\_ASSISTED\_GPS", "android.permission.ACCESS\_COARSE\_LOCATION", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_GPS", "android.permission.ACCESS\_LOCATION", "android.permission.ACCESS\_WIFI\_STATE", "android.permission.CALL\_PHONE", "android.permission.CHANGE\_WIFI\_STATE", "android.permission.MODIFY\_AUDIO\_SETTINGS", "android.permission.READ\_LOGS", "android.permission.RECORD\_AUDIO", "android.permission.VIBRATE", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, supportsScreens = { resizeable = false, smallScreens = true, normalScreens = true, largeScreens = true, xlargeScreens = true, }, }, plugins = { ["plugin.inmobi"] = { publisherId = "com.inmobi", }, }, }

main.lua important bits:

 --InMobi local Inmobi = require "plugin.inmobi" local appID = "b2e43e0xxxxxxxxxx" if system.getInfo( "platformName" ) == "Android" then appID = "b2bd26764xxxxxxxxxxx" end if system.getInfo( "environment" ) ~= "simulator" then Inmobi.initWithParams(appID, function(event) for k,v in pairs(event) do print("InMobi", k, v) end end, { logLevel=Inmobi.CONSTANTS.LOGLEVEL\_VERBOSE }) local interstitialAd = Inmobi.createInterstitialAd() interstitialAd.load() interstitialAd.show() end

So iOS returns this:

 <Warning>: InMobi message Error Domain=InMobi Code=0 “Invalid request. This could be due to an invalid InMobi app-id, or the app-id might not be in the Active state.” UserInfo=0x1b8e53a0 {NSLocalizedDescription=Invalid request. This could be due to an invalid InMobi app-id, or the app-id might not be in the Active state.}

Android, crashes as soon as I call interstitialAd.show() with:

12-15 21:22:29.513: I/Corona(27434): java.lang.NullPointerException

12-15 21:22:29.513: I/Corona(27434): Java Stack Trace:

12-15 21:22:29.513: I/Corona(27434): plugin.inmobi.LuaLoader$InterstitialAdWrapper.show(LuaLoader.java:833)

12-15 21:22:29.513: I/Corona(27434): plugin.inmobi.LuaLoader$createInterstitialAdWrapper$1.invoke(LuaLoader.java:646)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:372)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:374)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

12-15 21:22:29.513: I/Corona(27434): stack traceback:

12-15 21:22:29.513: I/Corona(27434): [C]: in function ‘show’

12-15 21:22:29.513: I/Corona(27434): ?: in main chunk

On the website:

Added the properties for ios and Android, pasted the store links (THE APP IS NOT LIVE YET ON EITHER PLATFORM) (they still say pending approval), enabled test mode, copied in my iPhone ID returned from the init function call into test devices.

Any ideas anyone?

I think the iOS one is missing something on the web side but not sure why Android is crashing.

So I’ve been trying to implement in mobi over the last day or two but I just cant get it working.  The code is simple:

build.settings important bits:

– Supported values for orientation: – portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = “portrait”, supported = { “portrait”, “portraitUpsideDown” } }, android = { versionCode = “10”, largeHeap = true, usesPermissions = { “com.android.vending.BILLING”, “android.permission.INTERNET”, “android.permission.READ_PHONE_STATE”, “android.permission.ACCESS_NETWORK_STATE”, “android.permission.ACCESS_ASSISTED_GPS”, “android.permission.ACCESS_COARSE_LOCATION”, “android.permission.ACCESS_FINE_LOCATION”, “android.permission.ACCESS_GPS”, “android.permission.ACCESS_LOCATION”, “android.permission.ACCESS_WIFI_STATE”, “android.permission.CALL_PHONE”, “android.permission.CHANGE_WIFI_STATE”, “android.permission.MODIFY_AUDIO_SETTINGS”, “android.permission.READ_LOGS”, “android.permission.RECORD_AUDIO”, “android.permission.VIBRATE”, “android.permission.WRITE_EXTERNAL_STORAGE”, }, supportsScreens = { resizeable = false, smallScreens = true, normalScreens = true, largeScreens = true, xlargeScreens = true, }, }, plugins = { [“plugin.inmobi”] = { publisherId = “com.inmobi”, }, }, }

main.lua important bits:

–InMobi local Inmobi = require “plugin.inmobi” local appID = “b2e43e0xxxxxxxxxx” if system.getInfo( “platformName” ) == “Android” then appID = “b2bd26764xxxxxxxxxxx” end if system.getInfo( “environment” ) ~= “simulator” then Inmobi.initWithParams(appID, function(event) for k,v in pairs(event) do print(“InMobi”, k, v) end end, { logLevel=Inmobi.CONSTANTS.LOGLEVEL_VERBOSE }) local interstitialAd = Inmobi.createInterstitialAd() interstitialAd.load() interstitialAd.show() end

So iOS returns this:

 <Warning>: InMobi message Error Domain=InMobi Code=0 “Invalid request. This could be due to an invalid InMobi app-id, or the app-id might not be in the Active state.” UserInfo=0x1b8e53a0 {NSLocalizedDescription=Invalid request. This could be due to an invalid InMobi app-id, or the app-id might not be in the Active state.}

Android, crashes as soon as I call interstitialAd.show() with:

12-15 21:22:29.513: I/Corona(27434): java.lang.NullPointerException

12-15 21:22:29.513: I/Corona(27434): Java Stack Trace:

12-15 21:22:29.513: I/Corona(27434): plugin.inmobi.LuaLoader$InterstitialAdWrapper.show(LuaLoader.java:833)

12-15 21:22:29.513: I/Corona(27434): plugin.inmobi.LuaLoader$createInterstitialAdWrapper$1.invoke(LuaLoader.java:646)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:372)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:374)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

12-15 21:22:29.513: I/Corona(27434): stack traceback:

12-15 21:22:29.513: I/Corona(27434): [C]: in function ‘show’

12-15 21:22:29.513: I/Corona(27434): ?: in main chunk

On the website:

Added the properties for ios and Android, pasted the store links (THE APP IS NOT LIVE YET ON EITHER PLATFORM) (they still say pending approval), enabled test mode, copied in my iPhone ID returned from the init function call into test devices.

Any ideas anyone?

I think the iOS one is missing something on the web side but not sure why Android is crashing.

Hey Phil

Sohan from InMobi here.

The invalid app_id error usually shows when the app hasn’t been verified yet. But since you have turned the test mode on, that shouldn’t be happening. 

Which version of Corona are you using btw? Starter, basic or pro? 

In the meanwhile let me get someone well-versed in Corona to take a look at this.

Hey Sohan, thanks!  I’m using Corona Pro, latest public release (2511).  I would be interested to know what you find!

Thanks Phil

Can you send me your app-id please? For the Android app. 

Sure I just messaged them to you

Hm. Can you try this:

  1. Try to run on the android device rather than on simulator with same code.
  2. Check if pings to i.w.inmobi.com are going and see what response you receive. You can use something like ‘Charles’ or any other http packet sniffer.

OK so the error I posted originally was from the Android device but I will try again tomorrow along with the sniffer. :slight_smile:

So I’ve been trying to implement in mobi over the last day or two but I just cant get it working.  The code is simple:

build.settings important bits:

– Supported values for orientation: – portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = “portrait”, supported = { “portrait”, “portraitUpsideDown” } }, android = { versionCode = “10”, largeHeap = true, usesPermissions = { “com.android.vending.BILLING”, “android.permission.INTERNET”, “android.permission.READ_PHONE_STATE”, “android.permission.ACCESS_NETWORK_STATE”, “android.permission.ACCESS_ASSISTED_GPS”, “android.permission.ACCESS_COARSE_LOCATION”, “android.permission.ACCESS_FINE_LOCATION”, “android.permission.ACCESS_GPS”, “android.permission.ACCESS_LOCATION”, “android.permission.ACCESS_WIFI_STATE”, “android.permission.CALL_PHONE”, “android.permission.CHANGE_WIFI_STATE”, “android.permission.MODIFY_AUDIO_SETTINGS”, “android.permission.READ_LOGS”, “android.permission.RECORD_AUDIO”, “android.permission.VIBRATE”, “android.permission.WRITE_EXTERNAL_STORAGE”, }, supportsScreens = { resizeable = false, smallScreens = true, normalScreens = true, largeScreens = true, xlargeScreens = true, }, }, plugins = { [“plugin.inmobi”] = { publisherId = “com.inmobi”, }, }, }

main.lua important bits:

–InMobi local Inmobi = require “plugin.inmobi” local appID = “b2e43e0xxxxxxxxxx” if system.getInfo( “platformName” ) == “Android” then appID = “b2bd26764xxxxxxxxxxx” end if system.getInfo( “environment” ) ~= “simulator” then Inmobi.initWithParams(appID, function(event) for k,v in pairs(event) do print(“InMobi”, k, v) end end, { logLevel=Inmobi.CONSTANTS.LOGLEVEL_VERBOSE }) local interstitialAd = Inmobi.createInterstitialAd() interstitialAd.load() interstitialAd.show() end

So iOS returns this:

 <Warning>: InMobi message Error Domain=InMobi Code=0 “Invalid request. This could be due to an invalid InMobi app-id, or the app-id might not be in the Active state.” UserInfo=0x1b8e53a0 {NSLocalizedDescription=Invalid request. This could be due to an invalid InMobi app-id, or the app-id might not be in the Active state.}

Android, crashes as soon as I call interstitialAd.show() with:

12-15 21:22:29.513: I/Corona(27434): java.lang.NullPointerException

12-15 21:22:29.513: I/Corona(27434): Java Stack Trace:

12-15 21:22:29.513: I/Corona(27434): plugin.inmobi.LuaLoader$InterstitialAdWrapper.show(LuaLoader.java:833)

12-15 21:22:29.513: I/Corona(27434): plugin.inmobi.LuaLoader$createInterstitialAdWrapper$1.invoke(LuaLoader.java:646)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:372)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:374)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611)

12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

12-15 21:22:29.513: I/Corona(27434): stack traceback:

12-15 21:22:29.513: I/Corona(27434): [C]: in function ‘show’

12-15 21:22:29.513: I/Corona(27434): ?: in main chunk

On the website:

Added the properties for ios and Android, pasted the store links (THE APP IS NOT LIVE YET ON EITHER PLATFORM) (they still say pending approval), enabled test mode, copied in my iPhone ID returned from the init function call into test devices.

Any ideas anyone?

I think the iOS one is missing something on the web side but not sure why Android is crashing.

Hey Phil

Sohan from InMobi here.

The invalid app_id error usually shows when the app hasn’t been verified yet. But since you have turned the test mode on, that shouldn’t be happening. 

Which version of Corona are you using btw? Starter, basic or pro? 

In the meanwhile let me get someone well-versed in Corona to take a look at this.

Hey Sohan, thanks!  I’m using Corona Pro, latest public release (2511).  I would be interested to know what you find!

Thanks Phil

Can you send me your app-id please? For the Android app. 

Sure I just messaged them to you

Hm. Can you try this:

  1. Try to run on the android device rather than on simulator with same code.
  2. Check if pings to i.w.inmobi.com are going and see what response you receive. You can use something like ‘Charles’ or any other http packet sniffer.

OK so the error I posted originally was from the Android device but I will try again tomorrow along with the sniffer. :slight_smile: