Android Google Drive客户端API+;安卓不工作
我正在尝试写一个android应用程序作为一个初学者,并没有运气到目前为止!!我正在尝试从用户驱动器帐户获取图像文件列表。通过我的探索,我了解到Google Drive for Android API并没有提供完整的访问范围。所以我必须使用Google API for Java客户端。我试着下载了。此任务应用程序在我的手机上运行良好。所以现在我把这个应用程序改成了谷歌硬盘。但它总是抛出一个例外。代码中的第38行读作Android Google Drive客户端API+;安卓不工作,android,google-drive-api,Android,Google Drive Api,我正在尝试写一个android应用程序作为一个初学者,并没有运气到目前为止!!我正在尝试从用户驱动器帐户获取图像文件列表。通过我的探索,我了解到Google Drive for Android API并没有提供完整的访问范围。所以我必须使用Google API for Java客户端。我试着下载了。此任务应用程序在我的手机上运行良好。所以现在我把这个应用程序改成了谷歌硬盘。但它总是抛出一个例外。代码中的第38行读作client.files().list().execute().getItems(
client.files().list().execute().getItems()代码>//客户端被定义为其他文件中的驱动器变量,我正在尝试从用户帐户获取文件列表
例外情况是:
08-24 15:00:33.712 15422-15473/gattasrikanth.googledrive.example E/DriveSample﹕ Error
com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException
at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:286)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
at gattasrikanth.googledrive.example.AsyncLoadTasks.doInBackground(AsyncLoadTasks.java:40)
at gattasrikanth.googledrive.example.CommonAsyncTask.doInBackground(CommonAsyncTask.java:57)
at gattasrikanth.googledrive.example.CommonAsyncTask.doInBackground(CommonAsyncTask.java:35)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: com.google.android.gms.auth.GoogleAuthException: Unknown
at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.getToken(GoogleAccountCredential.java:255)
at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:279)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
at gattasrikanth.googledrive.example.AsyncLoadTasks.doInBackground(AsyncLoadTasks.java:40)
at gattasrikanth.googledrive.example.CommonAsyncTask.doInBackground(CommonAsyncTask.java:57)
at gattasrikanth.googledrive.example.CommonAsyncTask.doInBackground(CommonAsyncTask.java:35)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
知道我哪里做错了吗。
我已经在谷歌控制台上正确设置了项目、软件包和SHA1。
不确定为什么它与TasksAPI一起工作,而与驱动器API不一起工作。为什么需要完整的驱动器作用域?要读取任何给定/根文件夹中可用的所有列表图像/文件。请尝试此-可能这对您有帮助,此-是!!这正是我所需要和帮助的!虽然几天前我就解决了。谢谢分享这些链接!