eclipse导入google-play-services_lib显示值的错误

将google-play-services_lib导入我的工作区,但在所有值文件夹中输入错误我有干净的项目更改Google API,添加google-play-services.jar文件,重启eclipse但错误 在此处输入图像描述

在控制台显示错误如下

[2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\ads_attrs.xml:10: error: Attribute "adSize" has already been defined [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\ads_attrs.xml:17: error: Attribute "adSizes" has already been defined [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\ads_attrs.xml:20: error: Attribute "adUnitId" has already been defined [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:4: error: Resource entry common_signin_btn_dark_text_default is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:4: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:5: error: Resource entry common_signin_btn_dark_text_pressed is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:5: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:6: error: Resource entry common_signin_btn_dark_text_disabled is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:6: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:7: error: Resource entry common_signin_btn_dark_text_focused is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:7: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:8: error: Resource entry common_signin_btn_light_text_default is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:8: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:9: error: Resource entry common_signin_btn_light_text_pressed is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:9: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:10: error: Resource entry common_signin_btn_light_text_disabled is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:10: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:11: error: Resource entry common_signin_btn_light_text_focused is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:11: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:12: error: Resource entry common_signin_btn_default_background is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:12: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_colors.xml:13: error: Resource entry common_action_bar_splitter is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\colors.xml:13: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\strings.xml:6: error: Resource entry common_google_play_services_install_title is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_strings.xml:21: Originally defined here. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\strings.xml:10: error: Resource entry common_google_play_services_install_text_phone is already defined. [2014-05-23 11:54:22 - GPSService] D:\AndroidTool\workspace\google-play-services_lib\res\values\common_strings.xml:25: Originally defined here. 

尝试导入库而不添加到工作区。 在我的情况下,这是一个解决方案。

我遇到了与colors.xml相同的问题,因为这个文件似乎不再存在了。 之前包含的颜色现在在common_colors.xml中声明。 您可能希望从项目中删除以前的Google Play Services文件夹以执行新的副本。

尝试从存在项目的同一文件夹中导入库,而不添加到工作区。

当我尝试更新我的谷歌播放服务版本时,这个错误出现了。 对我有用的完整过程是删除原始项目,从工作区中的其他项目中删除对play服务项目的所有引用(即打开项目属性并删除播放服务作为引用的Android库项目),然后导入游戏服务项目。 我不记得我是否Import Existing Projects into WorkspaceImport Existing Android Code

摆脱“最初定义的”错误的诀窍是首先删除对项目的现有旧引用。

我遇到了同样的问题,它是由extras \ google \ google_play_services \ libproject \ google-play-services_lib文件夹中的一些冲突的资源值引起的。

由于admob和analytics现已合并到Google Play服务中,我所做的是从SDK Manager和Google Play服务中卸载这些项目。 然后我重新安装了Google Play服务。 最终删除了重复的资源值,之后我的构建成功了。

您需要复制整个$SDK\sdk\extras\google\google_play_services文件夹,包括source.properties文件

删除旧项目,然后添加新项目,否则不会删除某些文件,这可能会导致类似这样的问题