Google 缺少 Play 服务 9.2.0 类

Google Play Services 9.2.0 missing classes

在 6 月 28 日 Google Play Services 9.2.0 更新后,缺少一些 类 阻止工作项目编译:

Error:(24, 35) error: package com.google.android.gms.maps does not exist

Google Places 也一样,所以如果您更新到 google play services 9.2.0,您的项目可能无法编译。

降级到 9.0.2 解决了问题:

compile 'com.google.android.gms:play-services-location:9.0.2'

有谁知道如何解决 9.2.0 版本中的问题?

添加 编译 'com.google.android.gms:play-services:9.2.0'

顺便说一句,检查的一个很好的起点是,在当前更新的 android 工作室(和库)中创建一个新的地图项目,看看有什么不同

只需添加地图库:

compile 'com.google.android.gms:play-services-maps:9.2.0'

和地方图书馆:

compile 'com.google.android.gms:play-services-places:9.2.0'

play-services-location 9.0.2依赖并自动引入你的项目play-services-mapsplay-services-places,看看play-services-location-9.0.2.pom。版本 9.2.0 不再这样做,因此您可以将其添加为项目依赖项。

对于其他缺失的类,您可以在此处查看以找到合适的包(参见Table 1 Individual APIs and corresponding build.gradle 描述): https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project