I'm trying to use Google Play Games Services, but when I call the Games.Achievements.unlock
or Games.Leaderboards.submitScore
I get the GoogleApiClient is not connected yet
GoogleApiClient must be connected
errors respectively.
The funny thing is that using Games.Leaderboards.getLeaderboardIntent
works and the score is displayed.
I tried to use the methods in onCreate
, onResume
, onStart
and it generates the same error.
no gradle has:
implementation 'com.google.android.gms:play-services-games:11.0.0'
implementation 'com.google.android.gms:play-services-auth:11.0.0'
implementation 'com.google.firebase:firebase-core:11.0.0'
By doing some testing, the above methods work on events, such as button clicks. But I need them to not depend on this user interaction.