Android Google Drive API 异常:403 禁止

Dan*_*ele 3 api android credentials drive

我正在开发一个可以访问 Google Drive 上用户的 appdata 文件夹的应用程序。当我处于调试模式时,该应用程序运行良好。当我发布应用程序并尝试连接到 Google Drive 时,在选择要连接的帐户后,它会出现此错误:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 
403 Forbidden 
{
   "errors" : [ {
      "domain" : "global",
      "reason" : "insufficientScopes",
      "message" : "The granted scopes do not give access to all of the requested spaces.",
      "locationType" : "parameter",
      "location" : "spaces"
   } ],
      "code" : 403,
      "message" : "The granted scopes do not give access to all of the requested spaces."
}
Run Code Online (Sandbox Code Playgroud)

我用这种方式连接到Google Drive:https://developers.google.com/drive/v3/web/quickstart/android

我还在 Google Dev Console 中制作了一份用于调试的凭据和一份用于发布模式的凭据。

我怎么解决这个问题?任何帮助都是值得赞赏的。谢谢朋友们!