GPGS Android: Disconnect from service while saving leads to crash
Closed this issue · 1 comments
MrStahlfelge commented
In very rare cases, app crashes with the following cause:
java.lang.IllegalStateException:
com.google.android.gms.games.internal.api.SnapshotsImpl.commitAndClose (SnapshotsImpl.java)
or .open$70b7f367 (SnapshotsImpl.java)
at de.golfgl.gdxgamesvcs.GpgsClient..saveGameStateSync (GpgsClient.java)
at de.golfgl.gdxgamesvcs.GpgsClient$4.doInBackground (GpgsClient.java)
This is probably caused by disconnecting from GPGS while cloud save is still running.
There are two possible approaches to prevent this crash:
- do not disconnect while cloud save is running
- catch the exception and return failed cloud save
MrStahlfelge commented
Fixed in v0.2.4 with exception catch like it is done when loading.