android - Google Play Location Services 9.2.0 缺少谷歌归因 Android 资源

标签 android gradle google-play-services location-services

我试图在 Android 应用程序(即 Locations API)中将对 Google Play 服务的依赖项从 9.0.2 升级到 9.2.0:

dependencies {
   ...
   compile 'com.google.android.gms:play-services-location:9.2.0'
   ...
}

API 是从 SDK Manager 下载的:

  • Google Play 服务,修订版 31
  • Google 知识库,修订版 29

但是,代码无法再编译,因为未找到可绘制资源,特别是 @drawable/powered_by_google_light(Google 的归属图片)。

检查 sdk_location/extras/google/m2repository/com/google/android/gms/play-services-location/9.2.0 下的 AAR,似乎缺少资源。实际上,AAR 中的 res 文件夹是空的。但是它存在于版本 9.0.2 中。

有人遇到过吗?我多次尝试从 SDK 管理器重新安装存储库。

最佳答案

通过添加对 Places API 的依赖关系解决了问题:

dependencies {
   ...
   compile 'com.google.android.gms:play-services-location:9.2.0'
   compile 'com.google.android.gms:play-services-places:9.2.0'
   ...
}

似乎在那个版本之前,Places 依赖项是隐式声明的。

还相关:Google Play Services 9.2.0 missing classes

关于android - Google Play Location Services 9.2.0 缺少谷歌归因 Android 资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38285219/

相关文章:

android - 仍在内部时接收地理围栏的退出通知

java - 如何像Javascript中的Promise一样检测Retrofit上的所有异步操作是否完成?

android - 尝试加载资源时,MediaMetadataRetriver.setDataSource在发行时崩溃(状态= 0x80000000)

android - 使用新的 Android Studio 项目,任务 ':app:dexDebug' 的 Gradle 执行失败

android-studio - 从Git导入Flutter项目时出现Gradle问题

unity-game-engine - Unity - 无法编译具有以下参数的资源 :

android - 如何通过 ADB 命令行逐步安装 Google Play 服务

android - java.lang.IllegalStateException : at android. View .ViewGroup.addViewInner

android - 按半径过滤标记。

android - 如何在 LinearLayout 中显示 TextView?