我正在我现有的应用程序中创建 Google Drive 集成。
我已按照 Google Drive 集成说明进行操作。
我使用 sha1 和包名称为 android 创建了 Oauth 2.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 多小时来搜索这个错误。