Tuesday 15 July 2014

Unable to add google play services library to the android project in eclipse and/or it shows as red cross.


Problem: When you try to add google-play-services_lib project to your android project in eclipse, it lets you
add it , but when u check back it show as a red cross with a question mark.

Soln: This could happen for three reasons:

1. The project.properties file of your project is read only. Sometimes by default (specially in widows 8) eclipse files are in read only stage and so when you add google play services  library from eclipse ui it is unable to edit the project.properties file and fails silently.

How to fix:

To fix this rt click on project.properties go to properties and check if the file read only check box is checked. If checked , uncheck clean build and re add the library.

2. The project.properties file is placed in an inaccessible location in your computer.

how to fix:

Restart your eclipse and run it as an administrator. Or
Change the location of your workspace.

3. The google play services library project is not imported properly into your workspace. This happens most of the time ,  if your project is kept in a different drive than your sdk tools folder. Eclipse while trying to import library sometimes (most of the times) changes or misses some file in the library. To verify this rt click on the imported library and check the size and file count , it would be different from the orginal copy of the library in sdk tools folder.

How to fix:

Create the workspace in the same drive as that of sdk installation, Or
copy the library project manually into ur workspace and then add itfrom there. Dont usethe eclipse import wizard.

No comments:

Post a Comment