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

前端 未结 5 1181
自闭症患者
自闭症患者 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 08:47

    I had the same problem, all permissions were granted and still I got this error.

    My simple problem was, that the googleSignInAccount.getSignInAccount().getAccount() was null. This is the case, if you do NOT request the email permissions (GoogleSignInOptions.Builder.requestEmail). Seems like this account can't be created without the user email.

    So make sure to add this permission to the GoogleSignInOptions...

提交回复
热议问题