MrStahlfelge/gdx-gamesvcs

GPGS Android: Disconnect from service while saving leads to crash

Closed this issue · 1 comments

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:

  1. do not disconnect while cloud save is running
  2. catch the exception and return failed cloud save

Fixed in v0.2.4 with exception catch like it is done when loading.