Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] Android crash on submitting incremental achievement with progress 0

Author
Message
tmu
8
Years of Service
User Offline
Joined: 2nd Feb 2017
Location:
Posted: 11th Feb 2017 21:25
Hi,

Yes so I had a look at the BUG thread and put the BUG in the subject..

The point. Tier 1 (basic), I build the actual APK, load it on the device, log in to Google Game Services for my app/game. Then comes the call

GameCenterSubmitAchievement("my_incremental_achievement_id",0)

This crashes the whole app with the usual "unfortunately <appname> has stopped" or so. This does not happen in my desktop dev environment or if I run the app using broadcast mode. Only when I install it as APK via Play Store or just load the APK myself. The difference may be due to the app not having access to the GameCenter otherwise or whatever. Not sure what causes the difference but when installed from APK file the above line crashes the app.

Found this in logcat which might be the cause:

java.lang.IllegalStateException: Number of steps must be greater than 0
at android.os.Parcel.readException(Parcel.java:1628)
at android.os.Parcel.readException(Parcel.java:1573)
at com.google.android.gms.games.internal.IGamesService$Stub$Proxy.zzb(Unknown Source)
at com.google.android.gms.games.internal.GamesClientImpl.zzb(Unknown Source)
at com.google.android.gms.games.internal.api.AchievementsImpl$8.zza(Unknown Source)
at com.google.android.gms.games.internal.api.AchievementsImpl$8.zza(Unknown Source)
at com.google.android.gms.internal.zzpr$zza.zzb(Unknown Source)
at com.google.android.gms.internal.zzqa.zzf(Unknown Source)
at com.google.android.gms.internal.zzqa.zzd(Unknown Source)
at com.google.android.gms.internal.zzqf.zzd(Unknown Source)
at com.google.android.gms.internal.zzqd.zzd(Unknown Source)
at com.google.android.gms.games.internal.api.AchievementsImpl.setSteps(Unknown Source)
at com.thegamecreators.agk_player.AGKHelper.GameCenterSubmitAchievement(AGKHelper.java:1885)

Maybe solution is to skip the submit if the value is 0? Not sure if that has any impact on some type of achievement on some platform though. At least catching the exception would be nice.

Cheers,
T
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Feb 2017 22:45
Quote: "Number of steps must be greater than 0"

The Game Services code is throwing an exception if it is given 0, I'll get AppGameKit to not pass it on if the value is 0.
tmu
8
Years of Service
User Offline
Joined: 2nd Feb 2017
Location:
Posted: 15th Feb 2017 15:35
Thanks. Since the method overwrites the achievement value, it would also be useful to be able to read leaderboard scores and achievement statuses if one wants to implement cross-device or re-install surviving incremental achievements.

Cheers,
T

Login to post a reply

Server time is: 2025-06-07 16:45:37
Your offset time is: 2025-06-07 16:45:37