Android错误:找不到符号类LocationClient

我的Android项目有问题。 由于此错误无法构建:错误:找不到符号类LocationClient。 我已经红了,你需要使用较低版本的google play服务,比如’com.google.android.gms:play-services:5. +’。

但当我使用那个时,我得到另一个错误:错误:属性“主题”已经定义。 当我用Google搜索时,我说我需要使用更高版本的google play服务,例如’com.google.android.gms:play-services:6. +’。

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

这是我的gradle脚本:

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。 它具有类似的function,因此易于更换。

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