I'm trying to implement the Drive API for Android to back-up a file to the AppFolder. I'm using the tutorial on Using the Google APIS Client Library for Java to integrate with Drive on Android and used some code snippets from the Quickstart.
.connect()
call is unsuccesful with error code SIGN_IN_REQUIRED
, which seems logical to me. onResume
method calls .connect()
again..connect()
call fails with the same error code (SIGN_IN_REQUIRED
) and the process repeats.In the API Manager of the Google Developer Console, I created a project for this app. In that project, I created an "OAuth 2.0 client ID" for the app with the debug package name and the SHA-1 for the debug key. In the manifest of the Quickstart, I didn't see the Client ID of said credential used anywhere.
Is this a known issue or did I make a mistake somewhere?
Edit:
I built the original Quickstart from scratch, and the error still occurred. It might therefore be an issue with the API Console rather than a client issue.
Not the solution I was expecting but here it is:
It turned out Android Studio was NOT signing my app with the debug key located at ~/.android/debug.keystore
, but with a different key.
Without knowing which key it was, I was able to figure out its SHA-1 using the method described in this SO question.