I am following the google drive android quick start sdk here. The only difference is that I am using intellij instead of eclipse.
The app throws an exception when uploading the file:
File file = service.files().insert(body, mediaContent).execute();
The exception message is access not configured
.
Now googling this error yields some results:
- google drive api error 403 Access Not configured
- Google Drive HTTP 403 "Access Not Configured" error with DrEdit
I have checked in the google cloud console that both the drive api & the drive sdk are activated. I have registered an app with the correct package name. I also added google cloud storage just in case. What else should I check?
Edit
I am really confused by the documentation. This page mentions the getToken
method, but the sample application uses GoogleAccountCredential.usingOAuth2
which documentation is Constructor a new instance using OAuth 2.0 scopes
.
When registering the application, I get some information like client secret/client ID. I could find information here explaining how to use this data, but I could not find this kind of example for an android app.