Google Drive API - the name must not be empty: null (But I had passed valid account name to GoogleAccountCredential)

前端 未结 5 1178
自闭症患者
自闭症患者 2020-12-03 08:12

Recently, I have Android code which accesses to Google Drive. I\'m using Google APIs Client Library for Java instead of Google Play services client

5条回答
  •  自闭症患者
    2020-12-03 09:01

    It looks like the Drive API Client Library for Java calls into GoogleAuthUtil.getToken(), which requires the GET_ACCOUNTS permission. You need to have that permission in your manifest and request it at runtime, as appropriate.

    UPDATE: With Google Drive REST v3 API, GET_ACCOUNTS permission is not required. Instead, Email permission is required. You can ask for it by calling GoogleSignInOptions.Builder.requestEmail.

提交回复
热议问题