【问题标题】:cannot resolve symbol GoogleApiClient无法解析符号 GoogleApiClient
【发布时间】:2015-05-15 21:23:27
【问题描述】:

在我的应用程序中,我使用的是 LocationManager,现在我想使用 Fused Location Services 我正在使用 Android Studio 1.1.0 并在 gradle 中添加了 google play 服务库

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':pull_to_refresh')
compile project(':uil_library')
compile project(':viewPagerIndicatorLib')
compile files('libs/date4j.jar')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.google.maps.android:android-maps-utils:0.3.+'
compile 'joda-time:joda-time:2.7'
compile 'com.github.shell-software:fab:1.0.5'
compile 'com.google.android.gms:play-services:6.5.87'
}

但是当我定义 GoogleApiClient 变量时它说

无法解析符号“GoogleApiClient”

所以我点击 alt+Enter 来导入它,但它显示“将库 'google-play-service-6.5.8.7' 添加到类路径”,所以我点击它,当我运行我的应用程序时它显示错误

错误:(9, 41) 错误: com.google.android.gms.common.api 包不存在 错误:(23, 13) 错误:找不到符号类 GoogleApiClient

我该如何解决这个问题以及首先是什么原因造成的。

【问题讨论】:

    标签: android-studio google-play-services android-fusedlocation


    【解决方案1】:

    我觉得很愚蠢:) 这个 gradle 在我的主应用程序中,但我在 Library 项目中使用 GoogleApiClient,所以我也必须将 compile 'com.google.android.gms:play-services:6.5.87' 添加到我的库中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-04
      • 2016-12-31
      相关资源
      最近更新 更多