更新时间:2022-10-15 08:00:37
嘿,我只是碰到了这个问题也。我没有发现太大的帮助,所以我做了很多的阅读和发现(https://developer.android.com/google/auth/api-client.html )在小记的GooglePlayServices API是德precated,每个人都必须迁移到GoogleApi代替。
请注意:如果你有一个现有的应用程序,连接到谷歌播放 与GooglePlayServicesClient的子类服务,你应该 一旦迁移到GoogleApiClient尽可能
我觉得Android的工作室一直没有更新,自动输入新的API,而不是旧的,后来在发展增加了登录活动时。
因此,任何依赖GooglePlayServices也必须更新,包括PlusClient和一帮他人。
我见过的迁移在互联网上的工具,但它可能只是使事情更容易做到这一点吧。希望这可以帮助。
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'
}
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.