【问题标题】:Google Clould Message demo setup : Dependencies not foundGoogle Cloud Message 演示设置:未找到依赖项
【发布时间】:2014-02-07 23:20:17
【问题描述】:

我想将 GCM 集成到我的 Android 应用中。一开始我想测试一下谷歌教程附带的 GCM 演示如何使用 GCM http://developer.android.com/google/gcm/client.html

我下载了演示项目并将其导入到我的 ADT eclipse 中。所以这就是我所做的:

  1. 我通过 SDK 管理器下载了“Google Play 服务”,另外还下载了“Google 存储库”

  2. 我将“/extras/google/google_play_services/libproject/google-play-services_lib/”复制到我的工作区(按照教程的建议)

  3. 在以下屏幕截图中,您可以看到我将“google-play-services_lib”的副本作为库添加到 GCM 演示项目

  4. 但是,依赖项未解决,如下面的屏幕截图所示:

那么我在指令链中的哪个点犯了错误?

【问题讨论】:

  • 选择Project Build TargetGoogle APIs 2.3.3
  • @toom GCM.jar 在哪里?

标签: android dependencies google-cloud-messaging


【解决方案1】:

Google Play 服务不包含 GCMRegistrar 类。该类是已弃用的 GCM 客户端库的一部分。不要使用GCMRegistrar,而是使用com.google.android.gms.gcm.GoogleCloudMessaging 类注册到GCM。

您使用的是旧版本的 GCM 演示。试试current version here

【讨论】:

    【解决方案2】:

    请遵循here的GCM示例代码

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-24
      • 1970-01-01
      • 1970-01-01
      • 2021-03-17
      • 2019-02-24
      • 2021-06-16
      相关资源
      最近更新 更多