Pollfish - NullPointerException when app starts

When I try to load my app with Pollfish on some Android devices, I get the following crash:

10-05 19:13:47.072  7456  7470 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference 10-05 19:13:47.072  7456  7470 W System.err:    at plugin.pollfish.LuaLoader.onResumed(LuaLoader.java:270) 10-05 19:13:47.072  7456  7470 W System.err:    at com.ansca.corona.CoronaEnvironment$RuntimeEventHandler.onResumed(CoronaEnvironment.java:509) 10-05 19:13:47.072  7456  7470 W System.err:    at com.ansca.corona.CoronaRuntime.onResumed(CoronaRuntime.java:408) 10-05 19:13:47.072  7456  7470 W System.err:    at com.ansca.corona.NativeToJavaBridge.callOnRuntimeResumed(NativeToJavaBridge.java:439) 10-05 19:13:47.072  7456  7470 W System.err:    at com.ansca.corona.JavaToNativeShim.nativeResume(Native Method) 10-05 19:13:47.072  7456  7470 W System.err:    at com.ansca.corona.JavaToNativeShim.resume(JavaToNativeShim.java:149) 10-05 19:13:47.072  7456  7470 W System.err:    at com.ansca.corona.Controller.updateRuntimeState(Controller.java:298) 10-05 19:13:47.072  7456  7470 W System.err:    at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421) 10-05 19:13:47.072  7456  7470 W System.err:    at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623) 10-05 19:13:47.072  7456  7470 W System.err:    at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)

This has happened on a Nexus 7 tablet with Android 6.0.1.

Can anyone help fix this crash?

Thanks

I’ll look into it and get back to you on this thread.

I have looked at the plugin code and found nothing obvious, and I haven’t been able to reproduce the issue.

I’ve tested on my Nexus 7 (2012) running Android 5.1.1

Does the app crash every time on your device, or just under certain circumstances?

The crash reproduces every time, but let me refine the conditions:

– Integrate the Pollfish plugin

– launch app

– Do not call pollfish.init()

– pause app

– resume app

– app crashes

I assume that the plugin expects you to initialize when the app starts, but since we need to provide the requestUUID we wait after the user logs in to perform this initialization. 

Does this help isolate the problem?

Perfection :slight_smile:

@stanga

A new plugin version has been pushed to the build server that should fix this issue.

Please try to build again, it should pick up the new version.

The problem is solved, thanks!

Just a quick question - do you intend to support Amazon in the near future?

@Stanga

Great to hear that the problem is fixed.

Plugins can only support one SDK, and at the moment the Pollfish SDK that the plugin is based on only supports Google Play.

I’ll look into it and get back to you on this thread.

I have looked at the plugin code and found nothing obvious, and I haven’t been able to reproduce the issue.

I’ve tested on my Nexus 7 (2012) running Android 5.1.1

Does the app crash every time on your device, or just under certain circumstances?

The crash reproduces every time, but let me refine the conditions:

– Integrate the Pollfish plugin

– launch app

– Do not call pollfish.init()

– pause app

– resume app

– app crashes

I assume that the plugin expects you to initialize when the app starts, but since we need to provide the requestUUID we wait after the user logs in to perform this initialization. 

Does this help isolate the problem?

Perfection :slight_smile:

@stanga

A new plugin version has been pushed to the build server that should fix this issue.

Please try to build again, it should pick up the new version.

The problem is solved, thanks!

Just a quick question - do you intend to support Amazon in the near future?

@Stanga

Great to hear that the problem is fixed.

Plugins can only support one SDK, and at the moment the Pollfish SDK that the plugin is based on only supports Google Play.