错误:包 GooglePlayServicesClient 不存在 [英] ERROR: Package GooglePlayServicesClient does not exist
问题描述
我使用 android studio 向我的应用程序添加了登录活动,但是我遇到了以下错误:
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
我已经在我的 SDK 管理器中安装了 google play 服务,所以我不确定为什么它告诉我该包不存在.
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.
摇篮文件:
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'
}
推荐答案
嘿,我也刚遇到这个问题.我没有找到太多帮助,所以我做了很多阅读并发现( https://developer.android.com/google/auth/api-client.html )在一个小说明中,GooglePlayServices API 已被弃用,每个人都必须迁移到 GoogleApi.
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.
注意:如果您有连接到 Google Play 的现有应用具有 GooglePlayServicesClient 子类的服务,您应该尽快迁移到 GoogleApiClient.
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.
我猜 Android Studio 尚未更新为在开发后期添加登录活动时自动输入新 API 而不是旧 API.
因此,任何依赖于 GooglePlayServices 的东西也必须更新,包括 PlusClient 和其他一些.
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.
我在 Internet 上看到过迁移工具,但它可能会让自己更轻松地完成迁移.希望这可以帮助.
I've seen migrating tools on the Internet but it might just make things easier to do it yourself. Hope this helps.
这篇关于错误:包 GooglePlayServicesClient 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!