Cannot resolve symbol 'GooglePlayServicesClient'

15,440

GooglePlayServicesClient is obsolete and no longer included in the Google Play Services 7.x library. Google recommends using the GoogleApiClient instead.

See Accessing Google APIs in the Android developer docs:

"Note: If you have an existing app that connects to Google Play services with a subclass of GooglePlayServicesClient, you should migrate to GoogleApiClient as soon as possible."

Share:
15,440
TRX
Author by

TRX

Updated on August 08, 2022

Comments

  • TRX
    TRX almost 2 years

    I am trying to migrate a project from Eclipse to Android Studio, the project can be build in Eclipse and was successful imported to Android Studio, however, I get Cannot resolve symbol 'GooglePlayServicesClient' error in Android Studio.

    I followed the official tutorial to imported Google Play service in Android Studio, and an other package "com.google.android.gms.common.ConnectionResult" that used in my project does not have same issue. Only 'GooglePlayServicesClient' cannot be resolved.

    issue

    I have also tried clean and rebuild my project, but the problem persists. What am I doing wrong?

    Update:

    My build.gradle

    ...
    dependencies {
        compile project(':libraryListViewAnimations')
        compile 'com.android.support:support-v4:21.0.3'
        compile 'com.android.support:appcompat-v7:21.0.3'
        compile 'com.google.android.gms:play-services:+'
        compile 'com.google.android.gms:play-services:7.0.0'
        compile files('libs/activation.jar')
        compile files('libs/additionnal.jar')
        compile files('libs/commons-net-3.1-sources.jar')
        compile files('libs/commons-net-3.1.jar')
        compile files('libs/mail.jar')
    }
    
  • TRX
    TRX over 9 years
    Yes, I have this line in my build.gradle file.
  • MichaelP
    MichaelP over 9 years
    i'm not sure why, but i saw it's duplicate two lines compile. You should choose latest version 'com.google.android.gms:play-services:+' compile 'com.google.android.gms:play-services:7.0.0'
  • MichaelP
    MichaelP over 9 years
    i just checked com.google.android.gms.common and saw class GooglePlayServicesClient. i'm not sure why you don't. Just get latest version and sync build gradle again.
  • Mathieu de Brito
    Mathieu de Brito about 9 years
    Do you have any result on this ?