【问题标题】:Upgrading from Play Services 7.5 to 7.8 - GCM APIs not found从 Play 服务 7.5 升级到 7.8 - 未找到 GCM API
【发布时间】:2015-08-17 19:00:35
【问题描述】:

从 7.50 -> 7.8.0 升级,然后 Android Studio 找不到 GCM 类。恢复到 7.5.0 可以解决此问题。

7.5.0 让 Android Studio 定位到InstanceID 和其他 GCM 类,但是将版本号升级到 7.8.0 后,这些 GCM 类就找不到了。

使用下面的 gradle 代码。 playServicesVersion = '7.5.0' 有效,但 playServicesVersion = '7.8.0' 无效。

    compile "com.google.android.gms:play-services-base:$playServicesVersion"
    compile "com.google.android.gms:play-services-appinvite:$playServicesVersion"
    compile "com.google.android.gms:play-services-analytics:$playServicesVersion"
    compile "com.google.android.gms:play-services-gcm:$playServicesVersion"

还有其他人有这个问题吗?

【问题讨论】:

  • 不,一切都很好
  • 对我也不起作用。
  • 完全相同的问题。清洁项目帮助我

标签: android gradle google-cloud-messaging google-play-services


【解决方案1】:

真的不知道为什么会发生这种情况 - 但在切换到构建工具 23 后,它起作用了。

【讨论】:

  • 是的,我也是。原因不明。
【解决方案2】:

基本上,我试图运行以下链接上提供的 gcm-demo 示例: git clone https://github.com/googlesamples/google-services.git

我所经历的是,即使我有 API 22 Google API Emulator 和最新的播放服务,当在模拟器上运行时,它也会抱怨播放服务已过时。我尝试将播放服务版本降级到 7.5,但即使我的 SDK 具有该版本,它也无法编译。最终,我通过降级 API 21 并迁移到 Google API 21 Emulator 映像解决了这个问题。它具有 7.8+ 版本的 Play Services,并且在该版本上运行良好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-30
    • 1970-01-01
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多