且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android无法解析导入com.google.android.gms.plus.PlusClient

更新时间:2023-11-19 09:01:22

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();
}