0

I'm trying to implement Google Drive functionality in our application and in stuck with such problem: using this code

try {
    // File's binary content
    java.io.File fileContent = new java.io.File(Environment.getExternalStorageDirectory() + "/miniclipId.txt");
    FileContent mediaContent = new FileContent("text/plain", fileContent);

    // File's metadata.
    File body = new File();
    body.setTitle(fileContent.getName());
    body.setMimeType("text/plain");

    FileList file = service.files().list().execute();
    if (file != null) {
        //showToast("Photo uploaded: " + file.getTitle());
        //startCameraIntent();
    }
} catch (UserRecoverableAuthIOException e) {
      startActivityForResult(e.getIntent(), REQUEST_AUTHORIZATION);
} catch (IOException e) {
      showToast(e.getMessage());
}

i'm trying to send simple text file to Google drive and, such a bad luck, i get this exeption:

{
  "code": 403,
  "errors": [
    {
      "domain": "usageLimits",
      "message": "Access Not Configured",
      "reason": "accessNotConfigured"
    }
  ],
  "message": "Access Not Configured"
}

I enabled Drive API in google API Console, entered SHA1 debug fingerprint and app's package name is exactly the same as entered in API Console. Any ideas please?

Kara
  • 6,115
  • 16
  • 50
  • 57
s0nicYouth
  • 470
  • 3
  • 15
  • A lot of dead code sorry. The query is FileList file = service.files().list().execute();. As is in an example on google drive api page. – s0nicYouth Jan 15 '13 at 13:09

2 Answers2

0

I went to the same error 2 months ago. My problem was the .android folder had some corrupt data (keystore I supouse) so I copied the folder from another PC where I was developing and solve it. Maybe it helps... anyway, if you don't have a backup of that folder, I would create the keystore again and enter the new certificate SHA1 in the API console. See google drive api error 403 Access Not configured

Community
  • 1
  • 1
Cabuxa.Mapache
  • 762
  • 1
  • 7
  • 19
0

Just Register your application aagain or delete the old Oauth Id and create a new one and you will not this error again: https://cloud.google.com/console#/project

https://groups.google.com/forum/#!topic/gs-discussion/9Ri4AwdHqDg