I am integrating Google Plus in my android app when I was trying to sign in to Google Plus my app just crashed. It says -
java.lang.IllegalStateException: GoogleApiClient must be connected
Below is the line number which stacktrace points towards,
if (Plus.AccountApi.getAccountName(mGoogleApiClient) != null)
@Override
public void onConnected(Bundle connectionHint) {
String personName = "Unknown";
if (Plus.AccountApi.getAccountName(mGoogleApiClient) != null) {
personName = Plus.AccountApi.getAccountName(mGoogleApiClient);
}
}
I have done all steps for integration, added Google play services to my project and registered my app on Google API's site.