I'm trying to use Google Play Games Services, but when calling Games.Achievements.unlock or Games.Leaderboards.submitScore I get errors GoogleApiClient is not connected yet and GoogleApiClient must be connected respectively.
The curious thing is that when using Games.Leaderboards.getLeaderboardIntent works and the scoreboard is displayed. I tried using the methods in onCreate, onResume, and onStart, and it generates the same error.
When calling those methods by some button click, it works. But i cant request my user to click a button to unlock some achievement.
In gradle:
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'