Nested network calls result in crash ... stack/heap size ?

Hi

I am making 3 nested network calls, so when the first one finishes the second fires etc… the first 2 works but the 3rd nested call crashes. The strange thing is that it works fine in the simulator and I get all the correct data. Here is the stack trace:

11-07 18:23:07.236: W/System.err(5768): com.naef.jnlua.LuaRuntimeException: SigntistData:545: java.lang.NullPointerException

11-07 18:23:07.236: W/System.err(5768): Java Stack Trace:

11-07 18:23:07.236: W/System.err(5768): network.NetworkRequest$NetworkRequestParameters.extractRequestParameters(NetworkRequest.java:907)

11-07 18:23:07.236: W/System.err(5768): network.NetworkRequest.invoke(NetworkRequest.java:1995)

11-07 18:23:07.236: W/System.err(5768): com.naef.jnlua.LuaState.lua_pcall(Native Method)

11-07 18:23:07.236: W/System.err(5768): com.naef.jnlua.LuaState.call(Unknown Source)

11-07 18:23:07.236: W/System.err(5768): com.ansca.corona.CoronaLua.dispatchEvent(CoronaLua.java:100)

11-07 18:23:07.236: W/System.err(5768): network.NetworkRequest$LuaCallback$1.executeUsing(NetworkRequest.java:603)

11-07 18:23:07.236: W/System.err(5768): com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:148)

11-07 18:23:07.236: W/System.err(5768): com.ansca.corona.events.EventManager.sendEvents(EventManager.java:87)

11-07 18:23:07.236: W/System.err(5768): com.ansca.corona.Controller.updateRuntimeState(Controller.java:281)

11-07 18:23:07.236: W/System.err(5768): com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:417)

11-07 18:23:07.236: W/System.err(5768): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1622)

11-07 18:23:07.236: W/System.err(5768): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

11-07 18:23:07.236: W/System.err(5768): at com.naef.jnlua.LuaState.lua_pcall(Native Method)

11-07 18:23:07.236: W/System.err(5768): at com.naef.jnlua.LuaState.call(Unknown Source)

11-07 18:23:07.236: W/System.err(5768): at com.ansca.corona.CoronaLua.dispatchEvent(CoronaLua.java:100)

11-07 18:23:07.236: W/System.err(5768): at network.NetworkRequest$LuaCallback$1.executeUsing(NetworkRequest.java:603)

11-07 18:23:07.236: W/System.err(5768): at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:148)

11-07 18:23:07.236: W/System.err(5768): at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:87)

11-07 18:23:07.236: W/System.err(5768): at com.ansca.corona.Controller.updateRuntimeState(Controller.java:281)

11-07 18:23:07.236: W/System.err(5768): at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:417)

11-07 18:23:07.236: W/System.err(5768): at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1622)

11-07 18:23:07.236: W/System.err(5768): at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

*********************************

Line 545 in SigntistData.lua is a simple network call:

local url = " … "

local params= {}

params.body = “token=” … “1234”

network.request(url, “GET”,  function(event) …) 

I have double checked the url and it is valid, if I paste it in a browser it works OK.

Since this works perfectly in the simulator and only fails on my Nexus5 Android device could it be a stack/heap memory settings issue ?

Thanks for the help !

Sanjit

Can you post more code?

Can you post more code?