Unable to build PlusClient

后端 未结 4 874
    import com.google.android.gms.common.ConnectionResult;
    import com.google.android.gms.common.GooglePlayServicesClient.ConnectionCallbacks;
    import com.goog         


        
相关标签:
4条回答
  • 2021-01-04 11:47

    If anybody still has this problem: the PlayClient is deprecated now. The "new" way to go is described here: http://android-developers.blogspot.com/2014/02/new-client-api-model-in-google-play.html

    mClient = new GoogleApiClient.Builder(this)
            .addApi(Drive.API)
            .addScope(Drive.SCOPE_FILE)
            .addApi(Plus.API, plusOptions)
            .addScope(Plus.SCOPE_PLUS_LOGIN)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();
    
    0 讨论(0)
  • 2021-01-04 11:50

    The error is because PlayClient is deprecated now, as Luigi04 states.

    As a work around, I got this working by downgrading the play services version in the gradle dependencies to 'com.google.android.gms:play-services:6.1.71', as stated here: https://stackoverflow.com/a/27637059/2161698

    0 讨论(0)
  • 2021-01-04 11:50

    I've got the same problem, the issue was that I was using old version of Google Play Service. So please update it to the latest version. Remember that new version is downloaded in sdk folder. If you earlier have imported google-play-services to your workspace you must delete it and add new version

    0 讨论(0)
  • 2021-01-04 11:50

    The jar by itself cannot be use. The entire google play services lib project needs to be imported ie copied from SDK.

    See step 5 of Google+ Quickstart:

    5. Import the Google Play Services library project.
    
    Select File > Import > Android > Existing Android Code Into Workspace and click Next.
    Select Browse.... Enter <android-sdk-folder>/extras/google/google_play_services/.
    Select google-play-services_lib. Click Finish to import.
    
    0 讨论(0)
提交回复
热议问题