小编Abd*_*sin的帖子

GoogleApiClient onConnectionFailed,statusCode = SIGN_IN_REQUIRED

我正在尝试将我的应用程序连接到Google Play服务以访问Google云端硬盘,但它显示我与statusCode的连接失败SIGN_IN_REQUIRED.

但它似乎就在3天前表现得那样.我也检查了谷歌的开发者控制台.他们可能在API中改变了一些我无法弄清楚的东西.欢迎您的帮助.

我的代码:

/**
 * Create a new file and save it to Drive.
 */
    private void saveFileToDrive(final byte[] data) {
    // Start by creating a new contents, and setting a callback.
    Log.i(TAG, "Creating new contents.");
    //final Bitmap image = mBitmapToSave;
    Drive.DriveApi.newDriveContents(mGoogleApiClient)
            .setResultCallback(new ResultCallback<DriveApi.DriveContentsResult>() {

                @Override
                public void onResult(DriveApi.DriveContentsResult result) {
                    // If the operation was not successful, we cannot do anything
                    // and must
                    // fail.
                    if (!result.getStatus().isSuccess()) {
                        Log.i(TAG, "Failed to create new contents.");
                        return; …
Run Code Online (Sandbox Code Playgroud)

android google-api google-api-client google-drive-android-api android-googleapiclient

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