Once the updateAchievement(int percentage)
function is called the game crashes as below
The game crashes with
Fatal signal 11 (SIGSEGV) at 0x00000088 (code=1), thread 6584 (Thread-6615)
at
static public void updateAchievement(int percentage)
{
if(gpgAvailable){
Games.Achievements.unlock(((RampJump)currentContext).getGameHelper().getApiClient(), achievementIDs[currentAchievementID]);
}
}
The achievements gets unlocked but the game crashes immediately. I am struck with this error for a long time. Please help regarding it. Thanks in advance.
Where do you initialize your Google API client? Personally, to unlock an achievement I use this:
public void unlockAchievement(int id)
{
Games.Achievements.unlock(mGoogleApiClient, AchievementIDs[id]);
}
"mGoogleApiClient" is initialized in OnCreate like so:
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN)
.addApi(Games.API).addScope(Games.SCOPE_GAMES)
.addApi(Drive.API).addScope(Drive.SCOPE_APPFOLDER)
.build();
I hope this helps :)
User contributions licensed under CC BY-SA 3.0