Java errors being captured in Lua global error handler

Hi Rob, as requested…

Since publishing my game with 3086 I am seeing a lot of low level errors being trapped.  

Some reference Google IAP, some Amazon IAP and some Vungle (I have raised with them directly for their plugin).  These are the only plugins I use that have direct network access.

Here are some examples

java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference

java.lang.NullPointerException Java Stack Trace: plugin.google.iap.v3.util.IabHelper.startSetup(IabHelper.java:272) plugin.google.iap.v3.LuaLoader.init(LuaLoader.java:159) plugin.google.iap.v3.LuaLoader.access$1200(LuaLoader.java:37) plugin.google.iap.v3.LuaLoader$InitWrapper.invoke(LuaLoader.java:445) com.ansca.corona.JavaToNativeShim.nativeRender(Native Method) com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:182) com.ansca.corona.Controller.updateRuntimeState(Controller.java:347) com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)

java.lang.NullPointerException: Attempt to invoke virtual method 'void com.ansca.corona.CoronaActivity.runOnUiThread(java.lang.Runnable)' on a null object reference

java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference Java Stack Trace: plugin.google.iap.v3.util.IabHelper.startSetup(IabHelper.java:272) plugin.google.iap.v3.LuaLoader.init(LuaLoader.java:159) plugin.google.iap.v3.LuaLoader.access$1200(LuaLoader.java:37) plugin.google.iap.v3.LuaLoader$InitWrapper.invoke(LuaLoader.java:445) com.ansca.corona.JavaToNativeShim.nativeRender(Native Method) com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:182) com.ansca.corona.Controller.updateRuntimeState(Controller.java:347) com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)

java.lang.NullPointerException Java Stack Trace: CoronaProvider.ads.vungle.LuaLoader.init(LuaLoader.java:171) CoronaProvider.ads.vungle.LuaLoader$InitWrapper.invoke(LuaLoader.java:144) com.ansca.corona.JavaToNativeShim.nativeRender(Native Method) com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:182) com.ansca.corona.Controller.updateRuntimeState(Controller.java:347) com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)

java.lang.IllegalArgumentException: Activity cannot be null. Java Stack Trace: plugin.amazon.iap.LuaLoader.init(LuaLoader.java:107) plugin.amazon.iap.LuaLoader$InitWrapper.invoke(LuaLoader.java:433) com.ansca.corona.JavaToNativeShim.nativeRender(Native Method) com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:182) com.ansca.corona.Controller.updateRuntimeState(Controller.java:347) com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421)

and sometimes just his

java.lang.NullPointerException

Thanks

Adrian

Can you quantify “lots”?

Could this be happening due to apps with networking issues?

What percentage of runs experience these errors?

Do you see them on your test devices?

How many are resulting in crashes or failures that don’t cure themselves later?

Rob

As you know these are real player logs from a live game.

This is making up some 50% of all errors logged in my game. And the volume is significant since I published with latest Corona. The following trace is what I see in Google Play.

I cannot tell you if these are unrecoverable errors or not but they are errors mainly (like 90%) involving Google or Amazon IAP plugins.

I do have players complaining that they cannot make purchases and maybe there is some correlation here?

We haven’t made changes to either IAP plugin in a long time. Perhaps Google had some issues around that time. What do the colors in the graph represent?  Do you have later data? The graph shows the problem dropping.

Have you tested your IAP code recently? 

Rob

I don’t suspect the actual plugin is at fault.  It is not just Google, it is Amazon IAP and Vungle ads too.

In the graph, green is total errors and blue is unique devices.  That is charting errors logged per day (I log all errors to GA) and the uplift corresponds with the “new” java errors being log (which were never logged in 3055 - i.e. my last production build).

Now it is entirely possible that Corona is simply reporting a greater range of errors and that they were always there (just hidden).  I know one of the changes between the two builds was errors being trappable now in callbacks - so maybe this is the source?

My point is more why are java errors being caught in lua error handling?  Surely one is completely abstracted from the other especially as I don’t use enterprise?

We believe you are correct. Build 3068 has more error trapping and this is likely a case of where you’re seeing and reporting more errors than you were previously. I know we have been addressing some issues off line and we’ve pushed a fix for NPE’s for Amazon and ANR’s for Google IAP and we are working on ANR’s for Facebook.

Can you categorize the errors you’re currently seeing by type and frequency?

Thanks

Rob

I am now on full roll out so that will take the next week to update everyone.  Then I should have the answer to this.  

Facebook should then be the only thing generating ANRs really.

But are you also still getting NPE’s (Null Pointer Exceptions)?

Yes because as I said it will take many days for Google to update all devices - longer for people on manual updates.

This what the ANRs look like for the staged roll out so far (most are Facebook to be honest)

I also have the same problem.  

@steve946, when you say you’re having the same problem, are you having “App Not Responding” (ANR) issues or are you having “Null Pointer Exceptions” (NPE)?  These are quite different issues.

Can you provide any stack trace’s that might hint towards the problem.

Are you using Google IAP?

Are you using Amazon IAP?

Are you using Facebook?

What version of Corona are you using?

Thanks

Rob

Can you quantify “lots”?

Could this be happening due to apps with networking issues?

What percentage of runs experience these errors?

Do you see them on your test devices?

How many are resulting in crashes or failures that don’t cure themselves later?

Rob

As you know these are real player logs from a live game.

This is making up some 50% of all errors logged in my game. And the volume is significant since I published with latest Corona. The following trace is what I see in Google Play.

I cannot tell you if these are unrecoverable errors or not but they are errors mainly (like 90%) involving Google or Amazon IAP plugins.

I do have players complaining that they cannot make purchases and maybe there is some correlation here?

We haven’t made changes to either IAP plugin in a long time. Perhaps Google had some issues around that time. What do the colors in the graph represent?  Do you have later data? The graph shows the problem dropping.

Have you tested your IAP code recently? 

Rob

I don’t suspect the actual plugin is at fault.  It is not just Google, it is Amazon IAP and Vungle ads too.

In the graph, green is total errors and blue is unique devices.  That is charting errors logged per day (I log all errors to GA) and the uplift corresponds with the “new” java errors being log (which were never logged in 3055 - i.e. my last production build).

Now it is entirely possible that Corona is simply reporting a greater range of errors and that they were always there (just hidden).  I know one of the changes between the two builds was errors being trappable now in callbacks - so maybe this is the source?

My point is more why are java errors being caught in lua error handling?  Surely one is completely abstracted from the other especially as I don’t use enterprise?

We believe you are correct. Build 3068 has more error trapping and this is likely a case of where you’re seeing and reporting more errors than you were previously. I know we have been addressing some issues off line and we’ve pushed a fix for NPE’s for Amazon and ANR’s for Google IAP and we are working on ANR’s for Facebook.

Can you categorize the errors you’re currently seeing by type and frequency?

Thanks

Rob

I am now on full roll out so that will take the next week to update everyone.  Then I should have the answer to this.  

Facebook should then be the only thing generating ANRs really.

But are you also still getting NPE’s (Null Pointer Exceptions)?

Yes because as I said it will take many days for Google to update all devices - longer for people on manual updates.

This what the ANRs look like for the staged roll out so far (most are Facebook to be honest)

I also have the same problem.