Android Drive GooglePlayServicesUtil﹕ The specified account could not be signed in

这一生的挚爱 提交于 2019-12-05 21:44:44

My guess is that there is a problem with the setup you did at the Developer's Console. This discussion may be helpful. – qbix

hello, reading the discussion qbix mention above i just found the cause of my problem...

the default flavor at my project structure had an incorrect Application id, i just change it to my app package "com.xxxxx.yyyyy".

so i beleave when googleApiClient attempted to connect, find diferent package name at id client credencials and deny access....

now is working fine thanx....

Here's my usual checklist:

1/ get the APK in question, push it through an unzipper, like 7-zip. you'll find a folder META-INF with a file CERT.RSA. Get it.

2/ run 'keytool -printcert -file ......\CERT.RSA' and copy/save the SHA1 '11.22.33...99'

3/ get you package name (from manifest?) 'com.blabla.yourproject'

4/ open developers console 'https://console.developers.google.com/project'

5/ in your project, check:

  • Enabled APIs: drive API
  • Credentials: Package name: 'com.blabla.yourproject', Fingerprint: '11.22.33...99'
  • Consent Screen: Email: yourmail@gmail.com , Product Name: 'YourProject'

Good Luck

Pleas try to First normal Google account Login

mGoogleApiClient = new GoogleApiClient.Builder(this).
addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API)
.addScope(new Scope(Scopes.PROFILE))
//.addApi(Drive.API)
//.addScope(Drive.SCOPE_FILE)
.build();

In my case cause was in incorrect 'package name' in OATH client settings: was: com.blabla.prog correct one: bla.bla.com.prog

try to ignore the API connection by doing this:

mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addApiIfAvailable(Drive.API)

I've done in this way and everything seems working. I really don't know why, i suppose that the Driver.API creates some problems, and doing in this way you can use the maps,the markers and all that stuff. I know that is not a good answer because i don't provide you a correct explanation, but anyway, it can help.

This type of error may occur in following situations:

  1. If you have used release key SHA1 signing-certificate fingerprint while creating Oauth 2.0 client ID and running your application without signing it with release key (i.e. running with debug key). This is also true for debug key.
  2. If you have used different package name while creating Oauth 2.0 client ID

Another thing that can go wrong is that you create credentials for "API Key" instead of "OAuth 2.0 client ID".

Yeah silly I know.. guide says "Client ID" so I guess I went by the length of the string :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!