Android无法解析导入com.google.android.gms.plus.PlusClient [英] Android The import com.google.android.gms.plus.PlusClient cannot be resolved

查看:473
本文介绍了Android无法解析导入com.google.android.gms.plus.PlusClient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新并导入了google-play-services_lib项目,并将此库添加到我的项目中,但它仍显示相同的错误导入com.google.android.gms.plus.PlusClient无法在

上解析

  import com.google.android.gms.plus.PlusClient; 

和PlusClient无法解析为

上的类型

  private PlusClient mPlusClient; 


解决方案

PlusClient在更新的播放服务中不可用。 p>

from 此链接

  private GoogleApiClient buildGoogleApiClient(){
//当我们构建我们指定GoogleApiClient在哪里连接,
//连接失败的回调应该返回,我们的
//应用使用哪些Google API以及哪些OAuth 2.0范围应用请求。
返回新的GoogleApiClient.Builder(SigninActivity.this).addConnectionCallbacks(this)
.addOnConnectionFailedListener(this).addApi(Plus.API,Plus.PlusOptions.builder()。build())
.addScope(Plus.SCOPE_PLUS_LOGIN).build();
}


I updated and imported google-play-services_lib project and added this library to my project still it is show the same error The import com.google.android.gms.plus.PlusClient cannot be resolved on

import com.google.android.gms.plus.PlusClient; 

and PlusClient cannot be resolved to a type on

private PlusClient mPlusClient;

解决方案

PlusClient is not available in updated play services.

from this link

  private GoogleApiClient buildGoogleApiClient() {
    // When we build the GoogleApiClient we specify where connected and
    // connection failed callbacks should be returned, which Google APIs our
    // app uses and which OAuth 2.0 scopes our app requests.
    return new     GoogleApiClient.Builder(SigninActivity.this).addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this).addApi(Plus.API,   Plus.PlusOptions.builder().build())
            .addScope(Plus.SCOPE_PLUS_LOGIN).build();
}

这篇关于Android无法解析导入com.google.android.gms.plus.PlusClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆