random crashes

Hello.

I have noticed a random crash affecting a few hundred users.

I can’t reproduce it but got some help from players and managed to find the reason.

The parameter create = true,  in gpgs.snapshots.open() causes random crashes.

gpgs.snapshots.open({ filename = "savedata", create = true, listener = gpgsSnapshotOpenForSaveListener })

If I comment out the line, everything works fine.

I’m using gpgs version 2 and the only difference I can see (compared to version 1) is that there is a change in conflictPolicy parameter’s default value. In version 1 was “last known good” and in version 2 is “manual”.

I have never used that parameter. Would it help if I was changing it to “last known good”?

Do they have a traceback or something?

Hi vlads.

Thank you for the reply.

at java.util.Hashtable.put (Hashtable.java:461) at plugin.gpgs.v2.Utils.gameToHashtable (Utils.java:282) at plugin.gpgs.v2.Utils.snapshotMetadataToHashtable (Utils.java:312) at plugin.gpgs.v2.Snapshots$OpenSnapshotOnCompleteListener.onComplete (Snapshots.java:503) at com.google.android.gms.tasks.zzj.run (Unknown Source:23) at android.os.Handler.handleCallback (Handler.java:794) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:173) at android.app.ActivityThread.main (ActivityThread.java:6634) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:822)

edit:

To be clear. Everything works fine with gpgs version 1.

It has to do with gpgs version 2 only.

That’s why I wrote about the change in conflictPolicy.

More users contacted with us about this crash and did some more tests.

On some devices the crash stops if comment out the parameter create = true,  in gpgs.snapshots.open().

On some others it doesn’t help and the crash keeps happening.

I understand you got a lot to do but not giving priority to things like this is a mistake.

Hey! Sorry for not responding earlier
Here’s code which is crashing:
yCOt0OP.png

Game description is returning Null and it crashes serialization. It seems like easiest solution would be to make sure to always have some description field when saving (it could be an empty string, but not nil)

So it’s not about gpgs.snapshots.open but gpgs.snapshots.save?

Something like this?

gpgs.snapshots.save({ snapshotId = event.snapshotId, description = "saved", listener = gpgsSnapshotAfterSaveListener })

Yes, it seems so. But code should be consistent. It seems once snapshot is saved w/o game description it should always fail on open. Try reproducing it first?

I can’t reproduce it in my devices.

I am using build 2019.3470 and gpgs v2 plugin.

 

I am also getting the following error trace from google play. 

Device: Samsung galaxy Note 8 and Android 8.0

 

But in my device I don’t get the error and I am seeing the error in a subset of players only.

 

java.lang.NullPointerException :

 

at java.util.Hashtable.put (Hashtable.java:461)

 

at plugin.gpgs.v2.Utils.gameToHashtable (Utils.java:282)

 

at plugin.gpgs.v2.Utils.snapshotMetadataToHashtable (Utils.java:312)

 

at plugin.gpgs.v2.Snapshots$OpenSnapshotOnCompleteListener.onComplete (Snapshots.java:503)

 

at com.google.android.gms.tasks.zzj.run (Unknown Source:23)

 

at android.os.Handler.handleCallback (Handler.java:789)

 

at android.os.Handler.dispatchMessage (Handler.java:98)

 

at android.os.Looper.loop (Looper.java:164)

 

at android.app.ActivityThread.main (ActivityThread.java:6940)

 

at java.lang.reflect.Method.invoke (Native Method)

 

at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)

 

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

@vlads

I just checked. I had game description " game score" from before already and still seeing the crashes. 

Another crash trace I am seeing is the following: 

java.lang.NullPointerException :

 

at java.util.Hashtable.put (Hashtable.java:442)

 

at plugin.gpgs.v2.Utils.gameToHashtable (Utils.java:282)

 

at plugin.gpgs.v2.Utils.snapshotMetadataToHashtable (Utils.java:312)

 

at plugin.gpgs.v2.Snapshots$OpenSnapshotOnCompleteListener.onComplete (Snapshots.java:503)

 

at com.google.android.gms.tasks.zzj.run (Unknown Source)

 

at android.os.Handler.handleCallback (Handler.java:751)

 

at android.os.Handler.dispatchMessage (Handler.java:95)

 

at android.os.Looper.loop (Looper.java:154)

 

at android.app.ActivityThread.main (ActivityThread.java:6682)

 

at java.lang.reflect.Method.invoke (Native Method)

 

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520)

 

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)

@vlads please check it again.

Crashes keep coming for the same reason although I did what you wrote.

Nothing?

Version 1 gives a lot of ANRs and version 2 a lot of crashes. 

Corona doesn’t have a working gpgs plugin right now.

It’s a big issue and nobody seems to care.

@Aarbron,

let’s wait awhile for Corona team to find a fix so that they can update us. :slight_smile:

@mysticeti

It’s not that simple when you get 1 star reviews and emails about an error that you can’t fix.

Corona should at least inform us about this issue. 

They don’t respond here or in emails.

I’m part of this community for almost 7 years and that kind of behaviour is really worrying.

I’ll re-ping our engineers.

Thank you Rob.

vlads wrote about missing (optional ) parameter description = “”.

I added it and the problem remains with users coming back after long breaks and even with new users!

Totally random.

Last crash was from s9 device although I have thousands users with that device without any problem!

Also you should keep the compatibility with gpgs version 1.

I didn’t have this (optional) parameter and everything worked fine!

That’s what should happen with version 2.

If you don’t change I will keep having random crashes with players coming back after long breaks.

Another user reported same issues in this topic and he uses the description parameter from the beginning. 

That complicates everything even more.

Please let me know when you have any news.

Thank you!

Makes sense. I added a lot of null checks. Now null values should just be ignored. Please, make a new build and see if you can reproduce a bug again.

First test.

Build with corona 2019.3473.

Retrieving saved data from snapshots doesn’t work any more.

vlads whatever you did broke the plugin even more!

gpgs.snapshots.open fails completely. Doesn’t even get to the listener parameter.

On the other hand log in reminds more the gpgs ver 1 and I like it.

Every time you install or delete app’s data the welcome message and choose account message both appear.

In gpgs version 2 it happens only the first ever time you install an application.  

Any details? Is there any output when you fail to load a game? “everything is broken” doesn’t really help.

I’m off work right now.

Later I will get some logs.

I made the post because it’s really serious.

gpgs.snapshots.open listener paramerter doesn’t work and you can’t get your saved snapshots.

local function gpgsSnapshotOpenForReadListener( event ) print( "snapshot open event:", json.prettify(event) ) if not event.isError then local data = event.snapshot.contents.read() native.showAlert('Snapshots', 'Reading was ' .. (event.isError and 'unsuccessful' or 'successful') .. ',', { 'OK'}) end end function myData.openSnapshot() print("Opening snapshot") myData.gpgs.snapshots.open({ filename = snapshotFilename, create = true, listener = gpgsSnapshotOpenForReadListener }) end

gpgsSnapshotOpenForReadListener doesn’t get called.

Imho you should check it soon.