Android API Google Drive“连接失败”

Android API Google Drive“连接失败”,第1张

概述我尝试在 Android上使用API​​ Google Drive,首先使用该演示: https://github.com/googledrive/android-quickstart 但是,我有这个错误,我无法解决. GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolutio 我尝试在 Android上使用API​​ Google Drive,首先使用该演示:

https://github.com/googledrive/android-quickstart

但是,我有这个错误,我无法解决.

Googleapiclient connection Failed:
ConnectionResult{statusCode=SIGN_IN_required,
resolution=PendingIntent{421d40e8: androID.os.BinderProxy@42137f78}}

@OverrIDepublic voID onConnectionFailed(ConnectionResult result) {    // Called whenever the API clIEnt fails to connect.    Log.i(TAG,"Googleapiclient connection Failed: " + result.toString());    if (!result.hasResolution()) {        // show the localized error dialog.        GooglePlayServicesUtil.getErrorDialog(result.getErrorCode(),this,0).show();        return;    }    // The failure has a resolution. Resolve it.    // Called typically when the app is not yet authorized,and an    // authorization    // dialog is displayed to the user.    try {        result.startResolutionForResult(this,REQUEST_CODE_RESolUTION);    } catch (SendIntentException e) {        Log.e(TAG,"Exception while starting resolution activity",e);        // There was an error with the resolution intent. Try again.        mGoogleapiclient.connect();    }}@OverrIDeprotected voID onActivityResult(final int requestCode,final int resultCode,final Intent data) {    if (requestCode == REQUEST_CODE_RESolUTION) {        if (resultCode == RESulT_OK) {            Log.i(TAG,"Error resolution success.");            // Make sure the app is not already connected or attempting to connect            if (!mGoogleapiclient.isConnecting() &&                    !mGoogleapiclient.isConnected()) {                mGoogleapiclient.connect();            }        } else {            GooglePlayServicesUtil.getErrorDialog(requestCode,0).show();        }        break;    }}
解决方法 这可能是由于开发人员的疏忽(因为它发生在我身上) – 您在控制台上提供的SHA1详细信息是生产密钥的详细信息,您正在测试调试模式(SHA1详细信息会有所不同).但是,谷歌驱动器API的错误消息可能会更好! 总结

以上是内存溢出为你收集整理的Android API Google Drive“连接失败”全部内容,希望文章能够帮你解决Android API Google Drive“连接失败”所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1130451.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存