0

I'm trying to integrate Google Drive into my app so that I can upload a text file that the app writes during runtime. To this end, I'm working through Google example code and followed the setup steps specified on the page.

The problem is that everytime I run the app, I select my Google account (I have two on my phone) and then a dialogue pops up that says "Unknown problem with Google Play services" (roughly translated) and this shows in the LogCat

I/android-drive-quickstart(18355): GoogleApiClient connection failed: ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null}

I suspect it has to do with OAuth registration on the Developer Console, but I have registered it exactly as specified by Google with my debug.keystore key.

What am I doing wrong??

PS. I noticed that all my apps have the same SHA1 key in my debug.keystore. Is this the way its supposed to be?

Yassie
  • 316
  • 1
  • 4
  • 14

1 Answers1

1

This may not solve your problem, but you may try double-check your auth parameters this way:

  1. find the APK file you are running (probably the debug flavor)
  2. use 7-zip or a similar unzipper and find \META-INF\CERT.RSA file inside
  3. extract it (to your Desktop, for instance)
  4. from console, run: keytool -printcert -file [yourpath]\Desktop\CERT.RSA

You should see the SHA1 of your APK. Go back to Developers Console and double-check if your packagename - SHA1 pair is correct. Assuming you have the 'Drive API' in APIs enabled.

As I said, this may not be the solution to your problem, but it does not hurt to check. It happened to me in the past, that my IDE was pointing to a different 'keystore' producing APK with incorrect SHA1.

seanpj
  • 6,735
  • 2
  • 33
  • 54
  • Thank you, this actually worked! But why does my debug.keystore key and my app key not match up? – Yassie Jan 14 '15 at 07:18
  • The *.keystore for debug and release are in different places. Search for *.keystore and you'll find it. I don't know what IDE you're using, so I can't help there. You can go to the console and add the debug SHA1 to your app package name (console > APIs > Credentials > New Client ID). But be careful, when you switch to release, all files created by the debug version will not be visible anymore (FILE scope). Changing your debug SHA1 to your release is not advised, but it can be done. see GIST here: https://gist.github.com/seanpjanson/e1c31725145e221bcc96 – seanpj Jan 14 '15 at 16:14