使用google plus登录时"无法创建与服务器的可靠连接"错误

dd6*_*619 6 android google-api oauth-2.0 google-plus

我正在开发一个应用程序,我想使用google plus登录.我已按照https://developers.google.com/+/mobile/android/sign-in中的步骤操作

但是当我尝试使用google api示例项目(从android sdk-> extras-> google services导入)登录google plus时,它始终显示 "无法创建与服务器的可靠连接".

我怎么解决呢?我正在真实设备上测试样本.

我的logcat如下,

05-17 15:21:56.500: E/GLSUser(6721): Empty consent data
05-17 15:21:56.500: I/GLSUser(6721): GLS error: NetworkError testid.android@gmail.com oauth2:https://www.googleapis.com/auth/plus.login
05-17 15:21:56.500: W/GLSUser(6721): Status from wire: NetworkError status: NETWORK_ERROR
Run Code Online (Sandbox Code Playgroud)

Mr *_*uni 16

按照https://developers.google.com/+/mobile/android/sign-in上的代码示例,我也获得了"空的同意数据".

但调用setScopes()PlusClient情况似乎要解决的问题:

mPlusClient = new PlusClient.Builder(this, this, this)
            .setVisibleActivities("http://schemas.google.com/AddActivity")
            .setScopes(Scopes.PLUS_LOGIN, Scopes.PLUS_PROFILE)
            .build();
Run Code Online (Sandbox Code Playgroud)

您是否在代码示例中设置了范围?