Runtime Error =simple:55: java.lang. NullPointerException

This error occurs only after building for my android phone. any idea on what it could mean or how to go about finding an answer? I’ve shifted around my code a bit so i don’t think the error is on line 55 of my own code, but maybe in the java.lang thing. I’m relatively new at coding so i’ve hit a wall as far as what to do here… please help

07-24 22:29:31.487 21394 21410 V Corona : > Class.forName: network.LuaLoader
07-24 22:29:31.487 21394 21410 V Corona : < Class.forName: network.LuaLoader
07-24 22:29:31.487 21394 21410 V Corona : Loading via reflection: network.LuaLo
ader
07-24 22:29:31.550 21394 21410 V Corona : > Class.forName: CoronaProvider.licen
sing.google.LuaLoader
07-24 22:29:31.550 21394 21410 V Corona : < Class.forName: CoronaProvider.licen
sing.google.LuaLoader
07-24 22:29:31.557 21394 21410 V Corona : Loading via reflection: CoronaProvide
r.licensing.google.LuaLoader
07-24 22:29:45.831 21394 21410 I Corona : Runtime error
07-24 22:29:45.831 21394 21410 I Corona : =simple:55: java.lang.NullPointerExce
ption
07-24 22:29:45.831 21394 21410 I Corona : Java Stack Trace:
07-24 22:29:45.831 21394 21410 I Corona : network.NetworkRequest$NetworkRe
questParameters.extractRequestParameters(NetworkRequest.java:884)
07-24 22:29:45.831 21394 21410 I Corona : network.NetworkRequest.invoke(Ne
tworkRequest.java:1881)
07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.JavaToNativeShi
m.nativeTouchEvent(Native Method)
07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.JavaToNativeShi
m.touchEvent(JavaToNativeShim.java:229)
07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.events.TouchEve
nt.Send(TouchEvent.java:17)
07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.events.EventMan
ager.sendEvents(EventManager.java:274)
07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.Controller.onDr
awFrame(Controller.java:230)
07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.opengl.CoronaGL
SurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:400)
07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.opengl.GLSurfac
eView$GLThread.guardedRun(GLSurfaceView.java:1622)
07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.opengl.GLSurfac
eView$GLThread.run(GLSurfaceView.java:1377)
07-24 22:29:45.831 21394 21410 I Corona : stack traceback:
07-24 22:29:45.831 21394 21410 I Corona : [C]: ?
07-24 22:29:45.831 21394 21410 I Corona : [C]: in function ‘request’
07-24 22:29:45.831 21394 21410 I Corona : =simple:55: in function ‘downloa
d’
07-24 22:29:45.831 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San
dbox\57\readJSON.lua:56: in function ‘readQuestions’
07-24 22:29:45.831 21394 21410 I Corona : C:\Users\Kev\DOCUM
07-24 22:29:45.862 21394 21410 I Corona : Runtime error
07-24 22:29:45.862 21394 21410 I Corona :
07-24 22:29:45.862 21394 21410 I Corona : stack traceback:
07-24 22:29:45.862 21394 21410 I Corona : [C]: ?
07-24 22:29:45.862 21394 21410 I Corona : [C]: in function ‘request’
07-24 22:29:45.862 21394 21410 I Corona : =simple:55: in function ‘downloa
d’
07-24 22:29:45.862 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San
dbox\57\readJSON.lua:56: in function ‘readQuestions’
07-24 22:29:45.862 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San
dbox\57\easy1.lua:37: in function <C:\Users\Kev\DOCUME~1\Outlaw\Sandbox\57\easy1
.lua:22>
07-24 22:29:45.862 21394 21410 I Corona : ?: in function ‘dispatchEvent’
07-24 22:29:45.862 21394 21410 I Corona : ?: in function ‘gotoScene’
07-24 22:29:45.862 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San
dbox\57\menu.lua:46: in function ‘onRelease’
07-24 22:29:45.862 21394 21410 I Corona : …:\Users\Kev\DOCUME~1\Outlaw\S
andbox\57\widget-v1.lua:285: in function <…:\Users\Kev\DOCUME~1\Outlaw\Sandbox
\57\widget-v1.lua:223>
07-24 22:29:45.862 21394 21410 I Corona : ?: in function <?:218>
 

Now, as for this error – I have no idea how to interpret this,
because I don’t know any Java. On the Corona side it looks like there
could be a problem downloading from mySQL database, right? But I’m not
sure since Java is babbling about some network problems early on (which
is strange, since facebookConnect works fine on the opening screen).

also, none of my transitions are working, such as a transition.to on the very first screen.

@koampapapa, I think you’ll need to post more about your set up and any details that you can think of that may give clues for the cause before anyone can help you.

I am on Mac, and I built Android version of my app today using Corona daily build 1170.  I deleted my previously installed version of my app from Android device, installed the new version of my game, launched it and played it.  I have lots of transitions, but I do not get java exception.

Naomi

The app also fails to run in the android emulator. I guess I expected that if it worked in the Corona Simulator, then it would work on Android as well? I’m using the most recent version of Corona simulator – might an older version package it better?

I don’t have a subscription to Corona so i’m currently using .1137. I’m on 64-bit windows building a trivia game for a non-profit organization. I would love to give more information as to this problem but I’m not sure what information would exactly help – it works well in the simulator so it’s not the .lua.  Most of my attempts at debugging haven’t worked – does anyone know of a debug-for-dummies tutorial that might allow me to gather more info on this error from the Android terminal?

 

Are there any particular files or lines of code within build.settings or config.lua that I could’ve missed? What is also strange is that it’s loading on my phone but then crashes, while in the emulator it doesnt even load.

@koampapapa, I have no idea if you missed something in config.lua or build.settings – and since I don’t use Windows or the emulator, I do not know what to tell.  One thing you really want to do is, though, setting up adb logcat so that you can view error logs on terminal with your Android device tethered to your PC.  Again, I don’t use Windows, and I do not know what steps you need to take to set it up.  When I did mine, I read Google developer docs and searched how-to wherever I could, and eventually got it to work.  I hope you’ll be able to get it set up properly quickly.  Meanwhile, let’s also hope someone else can join in and help you out.

Naomi

Thank you Naoimi. You have helped me greatly and I’ll be sure to paste this into the opening post.

07-24 22:29:31.487 21394 21410 V Corona : \> Class.forName: network.LuaLoader 07-24 22:29:31.487 21394 21410 V Corona : \< Class.forName: network.LuaLoader 07-24 22:29:31.487 21394 21410 V Corona : Loading via reflection: network.LuaLo ader 07-24 22:29:31.550 21394 21410 V Corona : \> Class.forName: CoronaProvider.licen sing.google.LuaLoader 07-24 22:29:31.550 21394 21410 V Corona : \< Class.forName: CoronaProvider.licen sing.google.LuaLoader 07-24 22:29:31.557 21394 21410 V Corona : Loading via reflection: CoronaProvide r.licensing.google.LuaLoader 07-24 22:29:45.831 21394 21410 I Corona : Runtime error 07-24 22:29:45.831 21394 21410 I Corona : =simple:55: java.lang.NullPointerExce ption 07-24 22:29:45.831 21394 21410 I Corona : Java Stack Trace: 07-24 22:29:45.831 21394 21410 I Corona : network.NetworkRequest$NetworkRe questParameters.extractRequestParameters(NetworkRequest.java:884) 07-24 22:29:45.831 21394 21410 I Corona : network.NetworkRequest.invoke(Ne tworkRequest.java:1881) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.JavaToNativeShi m.nativeTouchEvent(Native Method) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.JavaToNativeShi m.touchEvent(JavaToNativeShim.java:229) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.events.TouchEve nt.Send(TouchEvent.java:17) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.events.EventMan ager.sendEvents(EventManager.java:274) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.Controller.onDr awFrame(Controller.java:230) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.opengl.CoronaGL SurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:400) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.opengl.GLSurfac eView$GLThread.guardedRun(GLSurfaceView.java:1622) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.opengl.GLSurfac eView$GLThread.run(GLSurfaceView.java:1377) 07-24 22:29:45.831 21394 21410 I Corona : stack traceback: 07-24 22:29:45.831 21394 21410 I Corona : [C]: ? 07-24 22:29:45.831 21394 21410 I Corona : [C]: in function 'request' 07-24 22:29:45.831 21394 21410 I Corona : =simple:55: in function 'downloa d' 07-24 22:29:45.831 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San dbox\57\readJSON.lua:56: in function 'readQuestions' 07-24 22:29:45.831 21394 21410 I Corona : C:\Users\Kev\DOCUM 07-24 22:29:45.862 21394 21410 I Corona : Runtime error 07-24 22:29:45.862 21394 21410 I Corona : 07-24 22:29:45.862 21394 21410 I Corona : stack traceback: 07-24 22:29:45.862 21394 21410 I Corona : [C]: ? 07-24 22:29:45.862 21394 21410 I Corona : [C]: in function 'request' 07-24 22:29:45.862 21394 21410 I Corona : =simple:55: in function 'downloa d' 07-24 22:29:45.862 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San dbox\57\readJSON.lua:56: in function 'readQuestions' 07-24 22:29:45.862 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San dbox\57\easy1.lua:37: in function \<C:\Users\Kev\DOCUME~1\Outlaw\Sandbox\57\easy1 .lua:22\> 07-24 22:29:45.862 21394 21410 I Corona : ?: in function 'dispatchEvent' 07-24 22:29:45.862 21394 21410 I Corona : ?: in function 'gotoScene' 07-24 22:29:45.862 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San dbox\57\menu.lua:46: in function 'onRelease' 07-24 22:29:45.862 21394 21410 I Corona : ...:\Users\Kev\DOCUME~1\Outlaw\S andbox\57\widget-v1.lua:285: in function \<...:\Users\Kev\DOCUME~1\Outlaw\Sandbox \57\widget-v1.lua:223\> 07-24 22:29:45.862 21394 21410 I Corona : ?: in function \<?:218\>

Now, as for this error – I have no idea how to interpret this, because I don’t know any Java. On the Corona side it looks like there could be a problem downloading from mySQL database, right? But I’m not sure since Java is babbling about some network problems early on (which is strange, since facebookConnect works fine on the opening screen).

Ah, sorry, I guess you already had the logcat installed (because the log you posted kind’a looks identical between the first post and the last – I assumed you were getting the log from the emulator or something.  Errr… duh.)

Anyway, do you use google licensing?  Maybe it’s having trouble fetching component that is required for it?

Also, I assume you have readJSON.lua, easy1.lua, menu.lua and widget-v1.lua in your project folder – and it seems to be having troubling with network.request in a function called readQuestions in readJSON.lua?

Naomi

Naomi,

Thank you for your help. Using logcat adb (which I hadn’t had installed before you recommended it, I just edited my opening post after you suggested I download it), I was able to easily find the error in my code. Basically my network.download function wasn’t working because I had localized two variables instead of making them global, then it didn’t know what to do. Actually, I’m not entirely sure what I did to get it fixed, but I basically just shifted around some of the variables with what kinda sorta made sense and it ended up working out.

Love when that happens.

Thanks agin.

Ah, glad to hear it’s fixed now.

Cheers,

Naomi

also, none of my transitions are working, such as a transition.to on the very first screen.

@koampapapa, I think you’ll need to post more about your set up and any details that you can think of that may give clues for the cause before anyone can help you.

I am on Mac, and I built Android version of my app today using Corona daily build 1170.  I deleted my previously installed version of my app from Android device, installed the new version of my game, launched it and played it.  I have lots of transitions, but I do not get java exception.

Naomi

The app also fails to run in the android emulator. I guess I expected that if it worked in the Corona Simulator, then it would work on Android as well? I’m using the most recent version of Corona simulator – might an older version package it better?

I don’t have a subscription to Corona so i’m currently using .1137. I’m on 64-bit windows building a trivia game for a non-profit organization. I would love to give more information as to this problem but I’m not sure what information would exactly help – it works well in the simulator so it’s not the .lua.  Most of my attempts at debugging haven’t worked – does anyone know of a debug-for-dummies tutorial that might allow me to gather more info on this error from the Android terminal?

 

Are there any particular files or lines of code within build.settings or config.lua that I could’ve missed? What is also strange is that it’s loading on my phone but then crashes, while in the emulator it doesnt even load.

@koampapapa, I have no idea if you missed something in config.lua or build.settings – and since I don’t use Windows or the emulator, I do not know what to tell.  One thing you really want to do is, though, setting up adb logcat so that you can view error logs on terminal with your Android device tethered to your PC.  Again, I don’t use Windows, and I do not know what steps you need to take to set it up.  When I did mine, I read Google developer docs and searched how-to wherever I could, and eventually got it to work.  I hope you’ll be able to get it set up properly quickly.  Meanwhile, let’s also hope someone else can join in and help you out.

Naomi

Thank you Naoimi. You have helped me greatly and I’ll be sure to paste this into the opening post.

07-24 22:29:31.487 21394 21410 V Corona : \> Class.forName: network.LuaLoader 07-24 22:29:31.487 21394 21410 V Corona : \< Class.forName: network.LuaLoader 07-24 22:29:31.487 21394 21410 V Corona : Loading via reflection: network.LuaLo ader 07-24 22:29:31.550 21394 21410 V Corona : \> Class.forName: CoronaProvider.licen sing.google.LuaLoader 07-24 22:29:31.550 21394 21410 V Corona : \< Class.forName: CoronaProvider.licen sing.google.LuaLoader 07-24 22:29:31.557 21394 21410 V Corona : Loading via reflection: CoronaProvide r.licensing.google.LuaLoader 07-24 22:29:45.831 21394 21410 I Corona : Runtime error 07-24 22:29:45.831 21394 21410 I Corona : =simple:55: java.lang.NullPointerExce ption 07-24 22:29:45.831 21394 21410 I Corona : Java Stack Trace: 07-24 22:29:45.831 21394 21410 I Corona : network.NetworkRequest$NetworkRe questParameters.extractRequestParameters(NetworkRequest.java:884) 07-24 22:29:45.831 21394 21410 I Corona : network.NetworkRequest.invoke(Ne tworkRequest.java:1881) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.JavaToNativeShi m.nativeTouchEvent(Native Method) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.JavaToNativeShi m.touchEvent(JavaToNativeShim.java:229) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.events.TouchEve nt.Send(TouchEvent.java:17) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.events.EventMan ager.sendEvents(EventManager.java:274) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.Controller.onDr awFrame(Controller.java:230) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.opengl.CoronaGL SurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:400) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.opengl.GLSurfac eView$GLThread.guardedRun(GLSurfaceView.java:1622) 07-24 22:29:45.831 21394 21410 I Corona : com.ansca.corona.opengl.GLSurfac eView$GLThread.run(GLSurfaceView.java:1377) 07-24 22:29:45.831 21394 21410 I Corona : stack traceback: 07-24 22:29:45.831 21394 21410 I Corona : [C]: ? 07-24 22:29:45.831 21394 21410 I Corona : [C]: in function 'request' 07-24 22:29:45.831 21394 21410 I Corona : =simple:55: in function 'downloa d' 07-24 22:29:45.831 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San dbox\57\readJSON.lua:56: in function 'readQuestions' 07-24 22:29:45.831 21394 21410 I Corona : C:\Users\Kev\DOCUM 07-24 22:29:45.862 21394 21410 I Corona : Runtime error 07-24 22:29:45.862 21394 21410 I Corona : 07-24 22:29:45.862 21394 21410 I Corona : stack traceback: 07-24 22:29:45.862 21394 21410 I Corona : [C]: ? 07-24 22:29:45.862 21394 21410 I Corona : [C]: in function 'request' 07-24 22:29:45.862 21394 21410 I Corona : =simple:55: in function 'downloa d' 07-24 22:29:45.862 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San dbox\57\readJSON.lua:56: in function 'readQuestions' 07-24 22:29:45.862 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San dbox\57\easy1.lua:37: in function \<C:\Users\Kev\DOCUME~1\Outlaw\Sandbox\57\easy1 .lua:22\> 07-24 22:29:45.862 21394 21410 I Corona : ?: in function 'dispatchEvent' 07-24 22:29:45.862 21394 21410 I Corona : ?: in function 'gotoScene' 07-24 22:29:45.862 21394 21410 I Corona : C:\Users\Kev\DOCUME~1\Outlaw\San dbox\57\menu.lua:46: in function 'onRelease' 07-24 22:29:45.862 21394 21410 I Corona : ...:\Users\Kev\DOCUME~1\Outlaw\S andbox\57\widget-v1.lua:285: in function \<...:\Users\Kev\DOCUME~1\Outlaw\Sandbox \57\widget-v1.lua:223\> 07-24 22:29:45.862 21394 21410 I Corona : ?: in function \<?:218\>

Now, as for this error – I have no idea how to interpret this, because I don’t know any Java. On the Corona side it looks like there could be a problem downloading from mySQL database, right? But I’m not sure since Java is babbling about some network problems early on (which is strange, since facebookConnect works fine on the opening screen).

Ah, sorry, I guess you already had the logcat installed (because the log you posted kind’a looks identical between the first post and the last – I assumed you were getting the log from the emulator or something.  Errr… duh.)

Anyway, do you use google licensing?  Maybe it’s having trouble fetching component that is required for it?

Also, I assume you have readJSON.lua, easy1.lua, menu.lua and widget-v1.lua in your project folder – and it seems to be having troubling with network.request in a function called readQuestions in readJSON.lua?

Naomi

Naomi,

Thank you for your help. Using logcat adb (which I hadn’t had installed before you recommended it, I just edited my opening post after you suggested I download it), I was able to easily find the error in my code. Basically my network.download function wasn’t working because I had localized two variables instead of making them global, then it didn’t know what to do. Actually, I’m not entirely sure what I did to get it fixed, but I basically just shifted around some of the variables with what kinda sorta made sense and it ended up working out.

Love when that happens.

Thanks agin.

Ah, glad to hear it’s fixed now.

Cheers,

Naomi