In my android application, I am trying to get AccessToken from GoogleAuthUtil as below :
accessToken = GoogleAuthUtil.getToken(this, mPlusClient.getAccountName(), "oauth2:" + SCOPES);
But At this line I am gettting error as below :
E/GoogleAuthUtil(4696): Calling this from your main thread can lead to deadlock and/or ANRs E/GoogleAuthUtil(4696): java.lang.IllegalStateException: calling this from your main thread can lead to deadlock E/GoogleAuthUtil(4696): at com.google.android.gms.auth.GoogleAuthUtil.b(Unknown Source) E/GoogleAuthUtil(4696): at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source) E/GoogleAuthUtil(4696): at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
Any solution of this problem? Any help will be appreciated.