Eclipse import google-play-services_lib displays error in values

import google-play-services_lib into my workspace, but give an error in all the value folders I had a clean change to the Google API project, add the google-play-services.jar file, restart eclipse, but still errors enter image description here

if the console display error, as shown below

[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. 
+6
source share
7 answers

Try importing the library without adding it to the workspace. In my case, that was the solution.

+5
source

I ran into the same problem for colors.xml because this file does not seem to be present anymore. The colors that it contains earlier are now declared in common_colors.xml. You might want to delete the previous Google Play Services folder from your project to make a new copy.

+2
source

Try importing the library from the same folder where the project exists, without adding it to the workspace.

+1
source

This error occurred to me when I tried to update my version of Google Play services. The full process that worked for me was to remove the original project, remove all references to the game services project from my other projects in the workspace (that is, open the project properties and delete the playback services as an Android library project), and then import game services. I canโ€™t remember if I completed Import Existing Projects into Workspace or Import Existing Android Code .

The trick that got rid of the errors "originally defined here" was to first remove the existing old project links.

+1
source

I had the same problem and it was caused by some conflicting resource values โ€‹โ€‹in the extras \ google \ google_play_services \ libproject \ google-play-services_lib folder.

Since admob and analytics are now combined in Google Play Services, I removed these items from the SDK manager, as well as into Google Play Services. Then I just reinstalled Google Play Services. This led to the removal of duplicate resource values, after which my build was successful.

0
source

You need to copy the entire $SDK\sdk\extras\google\google_play_services , including source.properties file

0
source

Delete the old project and add a new one, otherwise some files will not be deleted, which may cause problems like this

0
source

Source: https://habr.com/ru/post/969731/


All Articles