GCM示例项目错误信息“无法找到google-play-services_lib.apk”

13

使用http://code.google.com/p/gcm/source/browse/#git%2Fgcm-client上提供的示例代码,应用程序启动协议包含有关缺少APK的消息。

[2013-06-22 10:28:24 - GCMClientNewAPI] ------------------------------
[2013-06-22 10:28:24 - GCMClientNewAPI] Android Launch!
[2013-06-22 10:28:24 - GCMClientNewAPI] adb is running normally.
[2013-06-22 10:28:24 - GCMClientNewAPI] Performing com.google.android.gcm.demo.app.DemoActivity activity launch
[2013-06-22 10:28:29 - GCMClientNewAPI] Uploading GCMClientNewAPI.apk onto device '015d3e63881c020d'
[2013-06-22 10:28:30 - GCMClientNewAPI] Installing GCMClientNewAPI.apk...
[2013-06-22 10:29:07 - GCMClientNewAPI] Success!
[2013-06-22 10:29:07 - google-play-services_lib] Could not find google-play-services_lib.apk!
[2013-06-22 10:29:07 - GCMClientNewAPI] Starting activity com.google.android.gcm.demo.app.DemoActivity on device 015d3e63881c020d
[2013-06-22 10:29:07 - GCMClientNewAPI] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.google.android.gcm.demo.app/.DemoActivity }

然而,该应用程序能够连接到Play服务并获取注册ID。发送消息似乎也正常工作——至少没有记录错误。

库项目被Android设置中的演示项目引用(如project.properties文件中所示)。

我正在使用当前的Android 4.2.2版本和当前的Google Play服务版本3.1.36(669520-30)在Nexus 7设备上进行测试。

什么可能会导致出现“找不到google-play-services_lib.apk”消息?

1个回答

24

该问题的解决方案在此问题的答案的评论中:

使用新版Google Play服务

步骤:

  1. 从Java构建路径中删除google_play_services-lib引用
  2. 在“属性”|“Android”|“库引用”中添加库引用

谢谢伙计... 你是冠军~~~ - Shridutt Kothari
@mjn 非常感谢,这对我很有帮助! - Keerthivasan
谢谢!它可以工作 - 尽管对我来说错误没有副作用 - 我已经添加了库引用。 - abdelrahman-sinno
这个可以编译,但是当我尝试运行项目时,出现了“无法执行dex:GC超过限制。GC overhead limit exceeded.”的错误提示。 - Killesk
好的,请查看此链接以解决“GC overhead limit exceeded”问题。https://dev59.com/EmAg5IYBdhLWcg3w3eNi - Killesk

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接