googleworkspace / android-samples

Android samples for Google Workspace APIs
Apache License 2.0
636 stars 410 forks source link

app not working and log shows Unsupported scope: https://www.googleapis.com/auth/drive #69

Closed jacobhub closed 6 years ago

jacobhub commented 6 years ago

I am trying to test the drive api, I manage to login but when trying to use drive api app crashes and logcat shows:

01-15 14:03:34.481 3090 3177 E ClientConnectOperation: nzh: Authorization failed: Unsupported scope: https://www.googleapis.com/auth/drive 01-15 14:03:34.481 3090 3177 E ClientConnectOperation: at nzl.a(:com.google.android.gms@11951440:25) 01-15 14:03:34.481 3090 3177 E ClientConnectOperation: at nvy.(:com.google.android.gms@11951440:26) 01-15 14:03:34.481 3090 3177 E ClientConnectOperation: at nxh.a(:com.google.android.gms@11951440:72) 01-15 14:03:34.481 3090 3177 E ClientConnectOperation: at swi.run(:com.google.android.gms@11951440:11) 01-15 14:03:34.481 3090 3177 E ClientConnectOperation: at mvc.run(:com.google.android.gms@11951440:26) 01-15 14:03:34.481 3090 3177 E ClientConnectOperation: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 01-15 14:03:34.481 3090 3177 E ClientConnectOperation: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 01-15 14:03:34.481 3090 3177 E ClientConnectOperation: at nak.run(:com.google.android.gms@11951440) 01-15 14:03:34.481 3090 3177 E ClientConnectOperation: at java.lang.Thread.run(Thread.java:761)

sgong-pdftron commented 6 years ago

Getting this as well... Anyone found any solution? Thanks!

grant commented 6 years ago

Can you be more specific which file/sample?

sgong-pdftron commented 6 years ago

I tried https://github.com/gsuitedevs/android-samples/blob/master/drive/demos/app/src/main/java/com/google/android/gms/drive/sample/demo/RetrieveMetadataActivity.java, the moment pickTextFile is called, I get "Unsupported scope" error shown in the title.

sgong-pdftron commented 6 years ago

Not sure if it matters, I was using Google v11.8.0. Tested on Moto G4.

sgong-pdftron commented 6 years ago

@grant were you able to reproduce or more information is needed? Thanks!

grant commented 6 years ago

Thanks for the details and pardon the response. Is this post related? https://stackoverflow.com/questions/29329863/google-drive-scopes-deprecated

I'm not sure of the issue here. (This sample was imported from a previous author).

CC @asrivas @sqrrrl who might understand this error more.

Pull Requests are welcome if you're able to fix the issue.

sqrrrl commented 6 years ago

Looking at BaseDemoActivity it only requests the file and appdata scopes. Just ran it myself (on emulator) and worked as expected.

@jacobhub and @sgong-pdftron - Did either of you modify BaseDemoActivity or make any other changes around auth?

kbboss commented 6 years ago

@sqrrrl hi , I have some troubles about how to file’s thumnail . How do you use api to get thumnail?

https://github.com/gsuitedevs/android-samples/issues/83

erickoledadevrel commented 6 years ago

It looks like your problems are with the API in general, and not these samples in particular. In that case, please see the support options here:

https://developers.google.com/drive/android/support

In regards to the scope issue, it is by design:

Note: The Google Drive Android API currently only supports drive.file and drive.appfolder authorization scopes. If your application requires additional permissions or features not yet available in the Drive Android API, you must use the Google APIs Java Client.

https://developers.google.com/drive/android/auth#connecting_and_authorizing_the_google_drive_android_api