Hi guys,
I have this code:
function saveDatosCloudGPS() print("START SAVE JSON SNAPSHOT ...") actualizarEnvioDatosCloud() print ( " Actualizando el valor de snapshot") snapshot.contents.write( json.encode( datosCloud ) ) print ( " Guardar el valor de snapshot en la nube") gpgs.snapshots.save({ snapshotId = snapshot.id, description = 'Salvando en la nube: ' .. snapshot.id, listener = function(event) print(" Snapshot guardada en nube") print("END SAVE JSON SNAPSHOT ...") end }) end
actualizarEnvioDatosCloud() is simply modify the table datosCloud.
The first time that I invoke saveDatosCloudGPS() it works PERFECTLY.
The second time that I invoke it happens this:
11-02 14:31:11.352 17594 17619 I Corona : Actualizando el valor de snapshot
11-02 14:31:11.355 17594 17619 I Corona : ERROR: Runtime error
11-02 14:31:11.355 17594 17619 I Corona : java.lang.NullPointerException: Attempt to invoke interface method ‘boolean com.google.android.gms.games.snapshot.SnapshotContents.writeBytes(byte[])’ on a null object reference
11-02 14:31:11.355 17594 17619 I Corona : Java Stack Trace:
11-02 14:31:11.355 17594 17619 I Corona : plugin.gpgs.Snapshots$SnapshotBridge$4.invoke(Snapshots.java:568)
11-02 14:31:11.355 17594 17619 I Corona : com.ansca.corona.JavaToNativeShim.nativeRender(Native Method)
11-02 14:31:11.355 17594 17619 I Corona : com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:182)
11-02 14:31:11.355 17594 17619 I Corona : com.ansca.corona.Controller.updateRuntimeState(Controller.java:333)
11-02 14:31:11.355 17594 17619 I Corona : com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421)
11-02 14:31:11.355 17594 17619 I Corona : com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623)
11-02 14:31:11.355 17594 17619 I Corona : com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)
11-02 14:31:11.355 17594 17619 I Corona : stack traceback:
11-02 14:31:11.355 17594 17619 I Corona : [C]: in function ‘write’
11-02 14:31:11.355 17594 17619 I Corona : ?: in function ‘saveDatosCloudGPS’
11-02 14:31:11.355 17594 17619 I Corona : ?: in function ‘method’
11-02 14:31:11.355 17594 17619 I Corona : /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:198: in function ‘dispatchEvent’
11-02 14:31:11.355 17594 17619 I Corona : /Users/jenkins/slavero
11-02 14:31:11.402 17594 17619 I Corona : systemEvent applicationSuspend
WTF ??