Android 为什么GoogleAppClient的blockingConnect方法返回ConnectionResult.Cancelled?

Android 为什么GoogleAppClient的blockingConnect方法返回ConnectionResult.Cancelled?,android,google-plus,google-play-services,google-api-client,Android,Google Plus,Google Play Services,Google Api Client,为什么GoogleAppClient的blockingConnect方法返回ConnectionResult.Cancelled,而在同一次调用中,我从OnConnectionFailedListener中获得ConnectionResult.SIGN\u 我认为blockingConnect方法应该返回与OnConnectionFailedListener.onConnectionFailed中相同的ConnectionResult 这是GoogleapClient中的一个bug吗 下面是一个

为什么GoogleAppClient的blockingConnect方法返回ConnectionResult.Cancelled,而在同一次调用中,我从OnConnectionFailedListener中获得ConnectionResult.SIGN\u

我认为blockingConnect方法应该返回与OnConnectionFailedListener.onConnectionFailed中相同的ConnectionResult

这是GoogleapClient中的一个bug吗

下面是一个示例代码(应该在后台线程中执行)


我使用的'com.google.android.gms:play services plus:7.3.0'

也有这个问题。这就是我到目前为止所说的。
当您在构建GoogleAppClient时显式设置帐户名时,blockingConnect方法返回成功。否则它将返回取消。但是,正如nLL在评论中提到的,blockingConnect会返回早期Play Services版本(特别是6.5.87版)中要求的登录,因此您可以尝试使用此版本。

我也有同样的问题。我相信这是游戏服务的一个bug,下面的2版本没有问题
 GoogleApiClient googleApiClient = new GoogleApiClient.Builder(LoginActivity.this)
                        .addApi(Plus.API)
                        .addScope(Plus.SCOPE_PLUS_LOGIN)
                        .addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
                            @Override
                            public void onConnectionFailed(ConnectionResult connectionResult) {

                            }
                        })
                        .build();
ConnectionResult connectionResult = googleApiClient.blockingConnect(30, TimeUnit.SECONDS);