Infinite “Choose an account” loop when using Google Drive API

前端 未结 3 1032
日久生厌
日久生厌 2020-12-10 08:31

I\'m trying to set up an Android app that can manipulate files stored on my personal Google Drive account using the guidelines at Google Drive REST API Overview.

I\'

相关标签:
3条回答
  • 2020-12-10 09:15

    One thing I can think of is that the value of setSelectedAccountName will default in to null if no PREF_ACCOUNT_NAME was retrieved, so this may contribute to the issue.

    The only difference I can see that you did was how you instantiated the mCredential. Try to check out the Authorizing requests for Android (using GoogleApiClient instead of GoogleAccountCredential.

    0 讨论(0)
  • 2020-12-10 09:20

    You must be using the official Google Drive Api Quickstart by Google. Link. I can confirm that it doesn't work unfortunately as of now. It leads to an infinite login loop even if I have only one gmail account on my device. Maybe consider using the code at their Drive Api page as a starting point. That should work

    0 讨论(0)
  • 2020-12-10 09:31

    I got the exact same problem, in my case the loop was due to the fact that I did not create my credentials for my app...

    The details are described here: https://developers.google.com/drive/android/get-started

    You must retrieve your SHA-1 keys for both the debug and production environments and add them in your credentials in the Google Developers Console as described in the guide.

    Once I added these credentials, the loop stopped right away.

    0 讨论(0)
提交回复
热议问题