Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: Package GooglePlayServicesClient does not exist

I have added a login activity to my app with android studio however I am running into these errors:

Error:(11, 37) error: cannot find symbol class GooglePlayServicesClient

Error:(13, 35) error: cannot find symbol class PlusClient

Error:(20, 44) error: package GooglePlayServicesClient does not exist

Error:(21, 33) error: package GooglePlayServicesClient does not exist

Error:(35, 13) error: cannot find symbol class PlusClient

Error:(279, 12) error: cannot find symbol class PlusClient

Error:(78, 31) error: package PlusClient does not exist

Error:(160, 65) error: package PlusClient does not exist

Error:(239, 5) error: method does not override or implement a method from a supertype

Error:(249, 5) error: method does not override or implement a method from a supertype

Error:(262, 5) error: method does not override or implement a method from a supertype

I have already installed google play services in my SDK manager so I'm not sure why it's telling me the package doesn't exist.

EDIT: Gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.example.tyler.titanaid"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:7.0.0'
}
like image 716
Tyler Pope Avatar asked Mar 27 '15 21:03

Tyler Pope


1 Answers

Hey I just ran into this problem also. I didn't find much help so I did a lot of reading and found ( https://developer.android.com/google/auth/api-client.html ) in a small note that the GooglePlayServices API is deprecated and everyone must migrate to GoogleApi instead.

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.

I guess Android Studio has not been updated to automatically input the new API instead of the old one, when adding a login activity later in development.
So anything that relies on GooglePlayServices must also be updated, including PlusClient and a bunch of others.

I've seen migrating tools on the Internet but it might just make things easier to do it yourself. Hope this helps.

like image 134
Jacob Elizondo Avatar answered Oct 30 '22 20:10

Jacob Elizondo