如何将Google Play服务添加到我的Eclipse ADT项目中 [英] How to add Google Play services to my Eclipse ADT project

查看:556
本文介绍了如何将Google Play服务添加到我的Eclipse ADT项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我正在修复的错误:



说明:错误:错误:找不到符合给定名称的资源( at'value',值为'@ integer / google_play_services_version')。
资源: AndroidManifest.xml
位置:行75
类型: Android AAPT问题





我试图实现我在< a href =https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project =nofollow noreferrer> https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project 在其他标签下的将Google Play服务添加到您的项目下。我已经在Android Studio中使用我的app / build.grandle文件的依赖关系{}部分中的以下行修复了此错误:

  compile'c​​om.google.android.gms:play-services:9.0.2'

但是,对于特殊情况,我需要在Eclipse ADT中实现相同的修复。使用Eclipse Android SDK Manager,我已经安装了Google Play服务,第39版:





我可以确认它是安装在我的电脑上C:\Users\jaimemontoya\android-sdks\extras\google\google_play_services:







从Eclipse我使用文件>导入...> Android>现有的Android代码到工作区>根目录:C:\Users\jaimemontoya\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ p>

要导入的项目:C:\Users\jaimemontoya\android-sdks\extras\google\google-play-services\libproject\google- play-services_lib
新项目名称:google-play -services_lib



然后从Eclipse包资源管理器我右键单击我的项目,进入属性,点击Android后,最后滚动我使用添加.. 。按钮添加google-play-services_lib库。它将显示为添加的库之一:





现在修复了错误:




This is the error I am trying to fix:

Description: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). Resource: AndroidManifest.xml Location: line 75 Type: Android AAPT Problem

I am trying to implement the solution I see at https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project, under "Add Google Play Services to Your Project", in the "OTHER" tab. I have already fixed this error in Android Studio by using the following line in the dependencies {} section of my app/build.grandle file:

compile 'com.google.android.gms:play-services:9.0.2'

However, for special circumstances, I need to implement the same fix in Eclipse ADT this time. Using the Eclipse Android SDK Manager, I already installed Google Play services, revision 39:

I can confirm it was installed on my computer at C:\Users\jaimemontoya\android-sdks\extras\google\google_play_services:

In the instructions at https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project, it says: "Copy the library project at /extras/google/google_play_services/libproject/google-play-services_lib/ to the location where you maintain your Android app projects."

As you can see in the image above, I do not have the /extras/google/google_play_services/libproject/google-play-services_lib/ folder in my Google Play services, revision 39 installation. Any ideas?

解决方案

I implemented the solution that Andrew S provided at Missing "<sdk>/extras/google/google_play_services/libproject" folder after update to revision 30. First, I downloaded https://dl-ssl.google.com/android/repository/google_play_services_8298000_r28.zip. That means that instead of the Google Play services, revision 39 that I was trying to use, I went to the older revision 28.

I extracted the file and placed it at C:\Users\jaimemontoya\android-sdks\extras\google\google-play-services:

From Eclipse I used File > Import... > Android > Existing Android Code Into Workspace > Root Directory: C:\Users\jaimemontoya\android-sdks\extras\google\google-play-services\libproject\google-play-services_lib

I confirmed everything looked correct:

Project to import: C:\Users\jaimemontoya\android-sdks\extras\google\google-play-services\libproject\google-play-services_lib New Project Name: google-play-services_lib

Then from the Eclipse Package Explorer I right-clicked my project, went to Properties, after that clicked Android and finally after scrolling down I used the "Add..." button to add the google-play-services_lib library. It will appeared as one of the added libraries:

The error is fixed for me now:

这篇关于如何将Google Play服务添加到我的Eclipse ADT项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆