Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 连线状态:无效\u密钥状态:空谷歌驱动器_Java_Android_Google Drive Api_Google Drive Android Api - Fatal编程技术网

Java 连线状态:无效\u密钥状态:空谷歌驱动器

Java 连线状态:无效\u密钥状态:空谷歌驱动器,java,android,google-drive-api,google-drive-android-api,Java,Android,Google Drive Api,Google Drive Android Api,我正在我现有的应用程序中创建Google Drive集成 我遵循了谷歌硬盘集成说明 我已经使用sha1和包名为android创建了OAuth2.0客户端密钥 我只是使用下面链接中的代码进行测试,但我无法让它运行 但每次我尝试上传文件时,我都会遇到以下异常 02-25 18:18:40.703: W/GLSActivity(1853): [anc] Status from wire: INVALID_KEY status: null 02-25 18:18:40.703: W/GLSActivi

我正在我现有的应用程序中创建Google Drive集成

我遵循了谷歌硬盘集成说明

我已经使用sha1和包名为android创建了OAuth2.0客户端密钥

我只是使用下面链接中的代码进行测试,但我无法让它运行

但每次我尝试上传文件时,我都会遇到以下异常

02-25 18:18:40.703: W/GLSActivity(1853): [anc] Status from wire: INVALID_KEY status: null
02-25 18:18:40.703: W/GLSActivity(1853): [anc] Status from wire: INVALID_KEY status: null
02-25 18:18:40.703: I/GLSUser(1853): GLS error: INVALID_KEY skypatel7@gmail.com oauth2:https://www.googleapis.com/auth/drive
02-25 18:18:40.710: W/GLSActivity(1853): [anc] Status from wire: Unknown status: UNKNOWN
02-25 18:18:40.710: W/System.err(24843): com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException
02-25 18:18:40.718: W/System.err(24843):    at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:224)
02-25 18:18:40.718: W/System.err(24843):    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859)
02-25 18:18:40.718: W/System.err(24843):    at com.google.api.client.googleapis.media.MediaHttpUploader.executeUploadInitiation(MediaHttpUploader.java:352)
02-25 18:18:40.718: W/System.err(24843):    at com.google.api.client.googleapis.media.MediaHttpUploader.upload(MediaHttpUploader.java:266)
02-25 18:18:40.718: W/System.err(24843):    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:408)
02-25 18:18:40.718: W/System.err(24843):    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:328)
02-25 18:18:40.718: W/System.err(24843):    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:449)
02-25 18:18:40.718: W/System.err(24843):    at com.skyproductivity.android.trackerdrive.MainActivity$1.run(MainActivity.java:116)
02-25 18:18:40.718: W/System.err(24843):    at java.lang.Thread.run(Thread.java:1019)
02-25 18:18:40.718: W/System.err(24843): Caused by: com.google.android.gms.auth.GoogleAuthException: Unknown
02-25 18:18:40.726: W/System.err(24843):    at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
02-25 18:18:40.726: W/System.err(24843):    at com.google.android.gms.Auth. GoogleAuthUtil.getToken(Unknown Source)
02-25 18:18:40.726: W/System.err(24843):    at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.getToken(GoogleAccountCredential.java:192)
02-25 18:18:40.726: W/System.err(24843):    at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:217)
02-25 18:18:40.726: W/System.err(24843):    ... 8 more
`


我已经花了50多小时搜索这个错误。

最后我放弃了使用谷歌支付服务使用谷歌驱动api的想法

我使用JavaAPI客户端进行google驱动

在此方法中,您需要使用webview进行身份验证。参考下面的教程


我有这个,我做的每件事都是对的,但还是失败了。最后我创建了一个新的
谷歌开发者控制台中的项目。在那里我又创造了一切。

这是一篇老文章。我不确定你是否得到了答案。但我的解决方案是: 这个错误很可能是由于您的Android客户端Id中存在一些错误。 在Android上,使用Android软件包名称和签名密钥的SHA-1指纹的组合来检索配置文件。 有以下两种解决方案: 1) 检查包名中是否有任何输入错误。 2) 您的系统上可能有多个Android密钥库,用于签署APK的密钥可能与您放在开发者控制台中的密钥不同。 例如:在Ubuntu上,当你打电话时

keytool-exportcert-alias androiddebugkey-keystore~/.android/debug.keystore-list-v

有两个位置:/root/.android和/home/ubuntu/.android。检查用于签署apk的SHA1键

谢谢。我希望这有帮助


Arpit

您是否解决了此错误?