Cannot resolve symbol GooglePlayServicesClient on new Android Studio Project

前端 未结 1 991
萌比男神i
萌比男神i 2020-12-03 13:12

I just installed Android Studio 1.1.0 and created a new project. I created it with a Login Activity including Google+ login.

As soon as the project opens, I see many

相关标签:
1条回答
  • 2020-12-03 13:57

    GooglePlayServicesClient class has been deprecated for some time. With latest GooglePlayServices release I believe they got rid of it completely.

    However, demo project in AndroidStudio still uses old APIs, so it won't compile :(

    Essentially, for talking to GooglePlayServices, you should use GoogleApiClient now (as described here https://developer.android.com/google/auth/api-client.html)

    Something like:

    GoogleApiClient googleApiClient = new GoogleApiClient.Builder(this)
                .addApi(Plus.API)
                .addConnectionCallbacks(this)
                .addOnConnectionFailedListener(this)
                .build();
    
    ................
    
    googleApiClient.connect();
    
    0 讨论(0)
提交回复
热议问题