简体   繁体   中英

Android app and Drive integration problems

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM