简体   繁体   English

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

[英]Why google-play-service is not found in my phonegap app as I already add the latest jar?

I am trying custom cordova plugin for GCM.我正在尝试 GCM 的自定义科尔多瓦插件。 I have included latest google-play-service.jar in project's libs folder and <meta-data android:name="com.google.android.gms.version" android:value="5089000" /> in AndroidMenifest.xml.我在项目的 libs 文件夹中包含了最新的google-play-service.jar,在 AndroidMenifest.xml 中包含了<meta-data android:name="com.google.android.gms.version" android:value="5089000" /> But still facing this problem...但是还是面临这个问题...

    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

I am developing android app on phonegap.我正在 phonegap 上开发 android 应用程序。 I have found this error message in console window.我在控制台窗口中发现了此错误消息。 I supposed to follow this Install the Google Play services SDK , but did't found any build.gradle and proguard-rules.txt我应该按照这个Install the Google Play services SDK ,但没有找到任何build.gradleproguard-rules.txt

Can any one tell the actual reason?谁能说出真正的原因? How can I include google-play-service in my phonegap project in an appropriate way?如何以适当的方式在我的 phonegap 项目中包含 google-play-service? Please help me.请帮我。 I am looking forward to hear from you soon.我期待着尽快收到您的来信。 Thank you.谢谢你。

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

This problem has been solved.这个问题已经解决了。 The solution has beed found here Cordova build problems after import google play service Google play service resources were missing from my phonegap project even after adding the google-play-service.jar in libs folder. 在导入 google play 服务后,我的 phonegap 项目中缺少 Google Play 服务资源,即使在 libs 文件夹中添加了 google-play-service.jar 后,已在此处找到解决方案Cordova 构建问题 So I had to configure the phonegap project.所以我不得不配置phonegap项目。 Steps are (copied from the link)...步骤是(从链接复制)...

  1. Firstly copy the whole google-play-services_lib folder from ANDROID_SDK_PATH\\extras\\google\\google_play_services\\libproject\\to your project root directory.(ie platform/android)首先将整个 google-play-services_lib 文件夹从 ANDROID_SDK_PATH\\extras\\google\\google_play_services\\libproject\\复制到您的项目根目录。(即平台/android)
  2. copy build.xml, local.properties & project.properties files from your project_root_folder/Cordova lib folder to google-play-services_lib folder.将 build.xml、local.properties 和 project.properties 文件从 project_root_folder/Cordova lib 文件夹复制到 google-play-services_lib 文件夹。
  3. Change the project.properties file's project target to the right target (ie android 19).将 project.properties 文件的项目目标更改为正确的目标(即 android 19)。 Open the project.properties from your Project Root folder and change reference 2 like this : android.library.reference.1=CordovaLib target=android-19 android.library.reference.2=google-play-services_lib从您的项目根文件夹打开 project.properties 并像这样更改参考 2:android.library.reference.1=CordovaLib target=android-19 android.library.reference.2=google-play-services_lib
  4. Goto the google-play-services folder in your project and run : android update project -p .转到项目中的 google-play-services 文件夹并运行: android update project -p 。 (don't forget dot) (不要忘记点)
  5. Then run following commands: ant debug ant release If you get any error then first run 'ant clean debug' then follow step然后运行以下命令: ant debug ant release 如果出现任何错误,请先运行“ant clean debug”,然后执行步骤
  6. Now you can run cordova build android OR if you are using ionic then ionic build android.现在你可以运行 cordova build android 或者如果你使用 ionic 然后 ionic build android。

Your logcat output says you have installed an outdated version.您的 logcat 输出表明您安装了过时的版本。 And you are following a blogpost from March 2014, perhaps you should try the official docs.您正在关注 2014 年 3 月的一篇博文,也许您应该尝试使用官方文档。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入google-play-service:资源“ / HomeActivity”已存在 - import google-play-service: Resource '/HomeActivity' already exists 导入google-play-service库,出现“找不到要导入的项目” - Importing google-play-service library, appear “No projects are found to import” 将Google Play服务源添加到我的Android应用程序中 - Adding google-play-service source to my android application 将Google Play服务导入Ecplise时出错 - Error in importing Google-play-service into Ecplise 为什么即使设备中已经存在最新版本,我在 Google Play 商店中的应用仍然要求更新? - Why does my app in Google Play Store urges to update even though the latest version is already present in device? 导入google-play-service依赖红叉 - import google-play-service dependency red cross 无法引用google-play-service lib。 我该如何解决? - Can't make a reference to google-play-service lib. How can i fix it? Google Play需要4132500-导入了任何google-play-service库版本 - Google play requires 4132500 - with any google-play-service library version imported 导入此参考android旁边显示红色X的google-play-service库 - Importing google-play-service library showing a red X next to this reference android Android显示“除非您更新Google Play服务,否则此应用程序将无法运行”,但我的Google Play服务是最新版本 - Android shows “This app won't run unless you update your google play service”, but my Google play service is the latest version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM