Android错误:找不到符号类LocationClient



我的Android项目有问题。由于以下错误,无法生成:error:找不到符号类LocationClient。我已经红了,你需要使用较低版本的谷歌播放服务,如"com.google.android.gms:play services:5.+'"

但当我使用这个时,我会得到另一个错误:错误:属性"主题"已经定义。当我在谷歌上搜索时,它说我需要使用更高版本的谷歌播放服务,比如"com.google.android.gms:play services:6.+"

所以我需要同时使用5.+和6.+版本,但这是不可能的。这个问题有什么解决办法吗?

这是我的渐变脚本:

apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:21'
buildToolsVersion "19.1.0"
defaultConfig {
    applicationId "app_id"
    minSdkVersion 19
    targetSdkVersion 21
}
buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
dependencies {
    //tried different versions of the librarys, without success
    compile 'com.android.support:support-v4:22.0.0'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:6.5.87'
    compile 'com.google.android.gms:play-services:5.+'
}

我能做的最好的事情就是用GoogleApiClient替换LocationClient。因为LocationClient已弃用。替换类是GoogleApiClient。它有类似的功能,所以很容易更换。

文件编制:https://developer.android.com/reference/com/google/android/gms/common/api/GoogleApiClient.html

最新更新