I am trying to authenticate the user following this gist by Ian Barber. The button asks for the user account, but it never gets to show the authorization dialog and instead exits with the message "An internal error ocurred". Logcat shows this:
W/GLSUser ( 4353): Status from wire: INVALID_KEY status: null
W/GLSUser ( 4353): Status from wire: INVALID_KEY status: null
E/GLSUser ( 4353): Empty consent data
I/GLSUser ( 4353): GLS error: INVALID_KEY icoloma@gmail.com oauth2:https://www.googleapis.com/auth/plus.login
W/GLSUser ( 4353): Status from wire: Unknown status: UNKNOWN
The certificate used to sign my app is the same configured at my Google API Console page, and the package name is also the same.
One more reason why this error occurs:
If you have a sub-package, ensure you only mention your application's main package in the developer's console, not the sub-package.
ex: If your App is under
com.example.myapp
, if your G+ login activity is under packagecom.example.myapp.authentication
, in the developer's console, the package name you enter should be com.example.myapp (leave out the subpackage)This happens when your certificate has been added in the "Simple API Access" section instead of "Client ID for installed applications". In the Google API console of your project click "Create an OAUTH2 client ID" (NOT "Create new Android Key"), select "Android" and introduce your SHA1 and package.
In my case this error occurred probably because I used sha256withrsa algorithm to sign my APK instead of sha1withrsa. Probably - I don't know for certain as I will not change my signature keys just because Google API is dumb.
I was getting a similiar error:
I fixed it by signing the APK using a keystore I generated. The keystore SHA was added to our Google Developer console.