Skip to content Skip to sidebar Skip to footer

Java.lang.IllegalStateException: GoogleApiClient Is Not Connected Yet

I'm trying to add achievements to my game by using google play game services. The activity in my game that is responsible for giving the achievement already extends BaseGameActivit

Solution 1:

Take a look at the basic sample https://github.com/playgameservices/android-basic-samples/tree/master/BasicSamples/TypeANumber. The connection flow for the Google APIs is asynchronous, so you can't unlock the achievement as you have it. There is a callback onConnected() which is called once the connection is established. In that method you can unlock the achievements.

The documentation for the api client is at http://developer.android.com/google/auth/api-client.html


Post a Comment for "Java.lang.IllegalStateException: GoogleApiClient Is Not Connected Yet"