小编lig*_*per的帖子

GoogleApiClient连接失败:ConnectionResult {statusCode = SIGN_IN_REQUIRED,

我试图将Google云端硬盘集成到我的应用程序中,但收效甚微。使用快速启动存储库中的代码,每次选择登录用户帐户时,都会收到以下错误消息:

I/DriveDemo: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{867e070: android.os.BinderProxy@13cdfe9}, message=null}
Run Code Online (Sandbox Code Playgroud)

我已按照以下网址上的说明进行操作:

  1. https://developers.google.com/drive/android/get-started
  2. https://github.com/googledrive/android-quickstart

并观看了以下视频:

  1. https://youtu.be/RezC1XP6jcs

我也看了无数Stack Overflow问题和答案,却不知道我在做什么错。

manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.lightkeeper54.chuck.drivedemo">

    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

码:

protected void onResume() {
    super.onResume();
    if (mGoogleApiClient == null) {
        // Create the API client and bind it to an instance variable.
        // We use this instance as the callback for connection and connection …
Run Code Online (Sandbox Code Playgroud)

android google-drive-api google-play-services google-drive-android-api

5
推荐指数
1
解决办法
4120
查看次数