为什么我的phonegap应用程序中找不到google-play-service,因为我已经添加了最新的jar?

时间:2014-08-11 07:17:09

标签: android cordova jar google-play-services

我正在为GCM尝试自定义cordova插件。我在项目的libs文件夹中包含了最新 google-play-service.jar,在AndroidMenifest.xml中包含了<meta-data android:name="com.google.android.gms.version" android:value="5089000" />。但仍面临这个问题...

    E/GooglePlayServicesUtil( 2808): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
W/GooglePlayServicesUtil( 2808): Google Play services out of date.  Requires 5089000 but found 4452030

我正在开发phonegap上的android应用程序。我在控制台窗口中发现了此错误消息。 我应该遵循这个Install the Google Play services SDK,但没有找到任何 build.gradle proguard-rules.txt

任何人都可以说实际的原因吗?如何以适当的方式在我的phonegap项目中添加google-play-service?请帮我。我很期待很快收到你的来信。谢谢。

2 个答案:

答案 0 :(得分:2)

 E/GooglePlayServicesUtil( 2808): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

这个问题已经解决了。解决方案已在此处找到Cordova build problems after import google play service 即使在libs文件夹中添加了google-play-service.jar,我的phonegap项目也缺少Google Play服务资源。所以我不得不配置phonegap项目。步骤是(从链接复制)......

  1. 首先从中复制整个google-play-services_lib文件夹 ANDROID_SDK_PATH \演员\谷歌\ google_play_services \ libproject \至 你的项目根目录。(即platform / android)
  2. 复制build.xml,     local.properties&amp;你的project.properties文件     project_root_folder / Cordova lib文件夹到google-play-services_lib     文件夹中。
  3. 将project.properties文件的项目目标更改为     正确的目标(即机器人19)。从中打开project.properties     您的Project Root文件夹并更改参考2,如下所示:     android.library.reference.1 = CordovaLib target = android-19     android.library.reference.2 =谷歌播放-services_lib
  4. 转到     项目中的google-play-services文件夹并运行:android update     项目-p。 (别忘了点)
  5. 然后运行以下命令:ant     debug ant release如果出现任何错误,请先运行'ant clean     调试'然后按照步骤
  6. 现在你可以运行cordova build android OR了 如果你正在使用离子然后离子构建android。

答案 1 :(得分:0)

您的logcat输出显示您已安装过时的版本。您正在关注2014年3月的博客文章,也许您应该尝试官方文档。

http://developer.android.com/google/play-services/setup.html