我正试图建立一个集成谷歌驱动器API并使用该驱动器作为存储存储的Android应用程序,但是我遇到了问题后开始。 我一直在尝试按照官方指南提供: https://developers.google.com/drive/android/get-started 以及另一个指南,我发现https://www.numetriclabz.com/integrate-google-drive-in-android-tutorial/,甚至下载源代码,只是更换我的API密钥,但与这两个指南我遇到了完全相同的问题。Google Drive Api无法连接/授权到谷歌帐户
每当我尝试测试运行应用程序,以查看是否应用程序被连接到驱动器,我得到在控制台下面的输出:
$ adb shell am start -n "app.googledrive/app.googledrive.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Connected to process 2889 on device emulator-5554
W/System: ClassLoader referenced unknown path: /data/app/app.googledrive-1/lib/x86
I/InstantRun: Instant Run Runtime started. Android package is app.googledrive, real application class is null.
[ 01-16 12:33:01.211 1561: 1584 D/ ]
HostConnection::get() New Host Connection established 0x953a3740, tid 1584
W/System: ClassLoader referenced unknown path: /data/app/app.googledrive-1/lib/x86
I/GMPM: App measurement is starting up, version: 8487
I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
E/EGL_emulation: tid 2930: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x94efd500, error=EGL_BAD_MATCH
I/Google Drive Activity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{e061739: [email protected]}, message=null}
另外,谷歌登录中弹出新增帐户对我来说,这意味着它连接到谷歌服务器,但不承认帐户/登录因为某种原因。我也尝试重新生成密钥库并将其重新添加到开发人员控制台并使用不受限制的密钥,但出现同样的问题。
我非常感谢有关如何解决此问题的任何帮助或建议,谢谢。
尝试在设备上,它可能与模拟器登录 – avinash
感谢@avinash的建议。我曾尝试直接在Android设备上运行它,但它仍然不允许我选择一个帐户并继续进行,因为每当我单击设备中的帐户时,android工作室中仍会出现以下消息: – user6709078
'01- 17 13:35:13.375 9923-9923/app.googledrive D/AppTracker:应用事件:开始 01-17 13:35:13.413 9923-9923/app.googledrive我/ Google云端硬盘活动:GoogleApiClient连接失败: ConnectionResult {statusCode = SIGN_IN_REQUIRED,resolution = PendingIntent {a77a4d3:[email protected]},message = null} 01-17 13:35:13.429 9923-9923/app.googledrive D/AppTracker:App Event:stop 01-17 13:35:13.445 9923-9923/app.googledrive D/AbstractTracker:活动成功 01-17 13:35:13.463 9923-9923/app.googledrive D/AbstractTracker:事件成功 ' – user6709078