Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android &引用;GoogleAppClient有一个可选的Plus.API,未连接到Plus";_Android_Google Api Client_Runtimeexception_Google Plus Signin - Fatal编程技术网

Android &引用;GoogleAppClient有一个可选的Plus.API,未连接到Plus";

Android &引用;GoogleAppClient有一个可选的Plus.API,未连接到Plus";,android,google-api-client,runtimeexception,google-plus-signin,Android,Google Api Client,Runtimeexception,Google Plus Signin,我正在为我的android应用程序使用google登录,最近我收到运行时异常报告,错误为“GoogleAppClient有一个可选的Plus.API,并且没有连接到Plus。使用GoogleAppClient.hasConnectedApi(Plus.API)来保护此调用。”在从google登录获得的活动结果中使用此选项 if (mGoogleApiClient.hasConnectedApi(Plus.API)) { Person person = Plus.Peop

我正在为我的android应用程序使用google登录,最近我收到运行时异常报告,错误为“GoogleAppClient有一个可选的Plus.API,并且没有连接到Plus。使用GoogleAppClient.hasConnectedApi(Plus.API)来保护此调用。

在从google登录获得的活动结果中使用此选项

if (mGoogleApiClient.hasConnectedApi(Plus.API)) {
            Person person  = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
            if (person != null) {
                //Take the required action 
                Log.i(TAG, "Display Name: " + person.getDisplayName());
                Log.i(TAG, "Gender: " + person.getGender());
                Log.i(TAG, "About Me: " + person.getAboutMe());
                Log.i(TAG, "Birthday: " + person.getBirthday());
                Log.i(TAG, "Current Location: " + person.getCurrentLocation());
                Log.i(TAG, "Language: " + person.getLanguage());
            } else {
                Log.e(TAG, "Error!");
            }