Android &引用;GoogleAppClient有一个可选的Plus.API,未连接到Plus";
我正在为我的android应用程序使用google登录,最近我收到运行时异常报告,错误为“GoogleAppClient有一个可选的Plus.API,并且没有连接到Plus。使用GoogleAppClient.hasConnectedApi(Plus.API)来保护此调用。”在从google登录获得的活动结果中使用此选项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
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!");
}