Google Drive Rest API:超出了未经身份验证的使用的每日限制.继续使用需要注册 [英] Google Drive Rest API: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup

查看:112
本文介绍了Google Drive Rest API:超出了未经身份验证的使用的每日限制.继续使用需要注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的应用程序从不建议使用的Google Drive Android API迁移到Drive Rest API.我使用新程序包实现了必需的行为,并且在模拟器中一切正常,该应用程序要求访问用户的云端硬盘并让其上传文件.当我开始在真实设备上对其进行测试时,出现此错误:

I'm migrating my app from deprecated Google Drive Android API to Drive Rest API. I implemented required behavior using new packages and everything works fine in emulator - app asks for access to user's Drive and getting it uploads files. When I started to test it on real device I get this error:

超出了未经身份验证的使用的每日限制.继续使用需要注册

Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup

我已经在 https://console.developers.google.com 中配置了项目,效果很好使用旧库(它具有必需的../auth/drive.file范围).根据迁移文档-旧配置应与新库一起使用而无需更改.

I already had configured project in https://console.developers.google.com that worked fine with old library (it has required ../auth/drive.file scope). According to migration documentation - old configuration should work with new library without changes.

此错误可能还有其他原因吗?

What other reasons could be for this error?

推荐答案

有趣的是,过去几天来我一直在处理此问题,并等待24小时以查看是否已解决问题.这是一个非常糟糕的问题.

Funny, I've been dealing with this the past so many days and waiting 24 hours to see if something fixed it. Its a really crappy problem.

主要答案

我觉得您使用的是ProGuard,就像我在真实设备"中假设的那样,您正在构建签名的APK,因为您没有指定是使用签名的还是调试的APK. ProGuard可能导致此错误发生.我使用以下方法修复了该问题.

I have a feeling you're using ProGuard same as I am assuming by "real device" that you're building signed apk as you do not specify if you're using signed or debug apk. ProGuard can cause this error to happen. I fixed it using the following.

# Fix OAuth Drive API failure for release builds
-keep class * extends com.google.api.client.json.GenericJson { *; }
-keep class com.google.api.services.drive.** { *; }
-keepclassmembers class * { @com.google.api.client.util.Key <fields>; }

次要答案

请注意,您不需要不需要在Android上通过Drive rest API使用按键/令牌,就像您从其他解决方案中可以找到的一样(虽然可能也没有害处,但是可以).它与人们在其他地方谈论的内容不匹配(在这里他们不知道自己在谈论什么).

Note that you DO NOT need to use keys/tokens using the Drive rest API with Android like you may find from other solutions (it may not hurt either, but it can). It doesn't match up here to what people talk about elsewhere (here they don't know what they're talking about).

在此处查看我的注释以获取更多信息: Google通过OAuth发布版本的云端硬盘每天都会收到LimitExceededUnreg

See my notes here for further info: Google Drive via OAuth release version receives dailyLimitExceededUnreg

但是,如果您在调试版本中遇到问题,则说明您没有正确执行所有操作.我的笔记应该可以让您走上正确的轨道.

IF you have the problem however in debug build then you did not do everything correctly. My notes should get you on the right track.

如果您需要进一步的帮助,可能会因为我的想法而有所帮助.

If you need further help, I might assist because of how nuts it is.

这篇关于Google Drive Rest API:超出了未经身份验证的使用的每日限制.继续使用需要注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆