无法从 google 服务库中找到 plus class

unable to find plus class from google services library

我正在按照 google+ API 中的教程进行操作 google 文档示例 https://developers.google.com/+/mobile/android/sign-in Everything worked well but I'm just not able to find Plus class from the google services library. This guy Can't resolve com.google.android.gms.plus.Plus class 遇到了同样的问题,但他通过更新 google 来自 sdk 的服务库,但我的情况是它已经更新,但我无法解决它。这是将 Plus API 添加到 google client

的代码
 mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addApi(Plus.API)
                .addScope(Scopes.PLUS_LOGIN)
                .addScope(Scopes.PLUS_ME)
                .build();

不要在 mGoogleApiClient 中添加范围。将其添加到 GoogleSignInOptions 对象。试试这个 -

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestProfile()
            .requestEmail()
            .requestScopes(new Scope(Scopes.PLUS_LOGIN))
            .build();

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this, this)
            .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
            .build();

    googleSignIn = (SignInButton) findViewById(R.id.google_sign_in);
    googleSignIn.setSize(SignInButton.SIZE_WIDE);
    googleSignIn.setScopes(gso.getScopeArray());