更新时间:2023-12-02 14:26:28
我遇到了同样的问题,但是我意识到由于凭据范围的原因,其设置不正确.我只有DriveScopes.DRIVE_METADATA设置,不足以下载文件.添加DriveScopes.DRIVE_FILE,DriveScopes.DRIVE和DriveScopes.DRIVE_APPDATA之后,我便可以毫无问题地下载文件.希望这可以帮助. P.S.如果要更改凭据,则必须删除以前保存的凭据文件.
I had the same issue but I realize that its because of the scope for credential wasn't setup properly. I only had DriveScopes.DRIVE_METADATA set which was not enough for downloading files. Once I added DriveScopes.DRIVE_FILE, DriveScopes.DRIVE, and DriveScopes.DRIVE_APPDATA, I was able to download the file without any problem. Hope this helps. P.S. if you are changing credentials, you have to delete the previously saved credential file.