How to Add Google Play Services to Your Project – Part 1
Below are the steps to integrate Google Play services to your project. First step is to install the Services SDK to Eclipse, second is to integrate this to our application.
Step 1
Install Google Play Services To Eclipse
1. Launch the SDK Manager
Select Window > Android SDK Manager.
2. Scroll to Bottom of the list and make sure Google play services is installed. Otherwise select the package and install it.
Step 2
Integrate Google Play Services To Our Application
Note: Play services is a library project so we have to import the project to our workplace.
1. We need to copy the library project from the SDK Location.
For that first go to Eclipse – Window > Preferences Select “Android” tab from top left corner. At the top, we can see the SDK LocationOpen that location in your Windows Explorer Or from Finder in your MAC machine. Once you open the SDK folder go to the following location /extras/google/google_play_services/libproject/. Then copy the folder google-play-services_lib. (This is the folder which needs to be imported)
2.Paste. Two options
Option a: As we are working as groups under different version controls like SVN, git, mercurial etc. The general practice I followed is to add this(copied folder – google-play-services_lib) to one of our locations in our version control and checkout it to our local machine.
Option b: Simply paste the google-play-services_lib folder to any of your location say workplace.
Note: The below method is not right File > Import, select General> Existing Projects into Workspace
4. Refer the Google Play services library project to our Application.
Select your project (not the Google Play services Library Project), then right click on it. Select Properties > Select Android tab from top left corner > In the Library Section Press Add Select google-play-services_lib project and press OK. You can see a green tick in the Library Section left to Google Play Service Library if everything is done right.
In the next part we will deal with ‘how to handle Google Play services not installed in the device’ condition and implement sample Map Apis and may be GCM.
Paste google services folder in any location in your my computer (eg: G:\Android\Projects in windows or Users//Documents/Projects)…. Then import that project to eclipse as in Step 2 explained (File > Import, select Android > Existing Android Code into Workspace)
http://i.imgur.com/aYzfLPQ.png
After I imported the lib eclipse shows a red exclamation mark, as you can see the bin folder is empty and so is manifest file. Cleaning doesnt help, how can I fix this?
greyshack : I also faced the same problem , the solution that worked for me was like this :
Solution :
Error : First -> I got a red exclamation mark as u had got
Solution : I restarted the eclipse
Solved
Next, after removal of that mark when i tries adding it to my project I got the error of the project not opening because it was missing the “.project file” , i tried copying it from the folder to the project in eclipse but of no use
Solution : I deleted it and imported it again
Solved
hello, help me please…
after imported google lay service then the values of google play service are error. how to fix them ? the message is :
google-play-services_lib\res\values-zu\strings.xml:18: error: Resource entry common_google_play_services_unsupported_title is already defined.
[2014-11-11 17:38:22 – TampilPeta] D:\Androidku\google-play-services_lib\res\values-zu\common_strings.xml:26: Originally defined here.
[2014-11-11 17:38:22 – TampilPeta] D:\Androidku\google-play-services_lib\res\values-zu\strings.xml:19: error: Resource entry common_google_play_services_unsupported_text is already defined.
[2014-11-11 17:38:22 – TampilPeta] D:\Androidku\google-play-services_lib\res\values-zu\common_strings.xml:27: Originally defined here.
thanks for it 🙂
after it i want to generate gradle file for android studio so i m exporting the project . in that when i select project it shows error like this.
Project../google_play_services/libproject/google_play_services_lib is missing. Needed by LocationDistanceTimeMapV2
Google play services library project will not be needed anymore in the case of android studio. Please do the below
1. Remove the play services library project dependency in gradle file (we dont need to link to library project anymore in android studio)
2. Remove the play services library project folder
3.Add the play services dependency just like in this link https://developers.google.com/android/guides/setup .
YOU ARE A GENIUS, BECAUSE I ALWAYS PUTS GENERAL INSTEAD ANDROID! I WAS 10 HOURS UNTIL I ARRIVED HERE. THANK YOU VERY MUCH!!!
LikeLiked by 1 person
great to know it helped you!! 🙂
LikeLike
My project selection dialog is empty 😦 Where should i paste the google-play-services_lib project?
LikeLike
Paste google services folder in any location in your my computer (eg: G:\Android\Projects in windows or Users//Documents/Projects)…. Then import that project to eclipse as in Step 2 explained (File > Import, select Android > Existing Android Code into Workspace)
LikeLike
if i download google-play-services_lib from new version(ADT ) and use it in old version of ADT SDK
LikeLike
not sure about that.. it should work though.. i think you must try and find what happens 🙂
LikeLike
after i import the google play service lib the values of the google play service lib are error how to fix this?
LikeLike
Please provide more details on the error.. Error messages or anything like that..
LikeLike
http://i.imgur.com/aYzfLPQ.png
After I imported the lib eclipse shows a red exclamation mark, as you can see the bin folder is empty and so is manifest file. Cleaning doesnt help, how can I fix this?
LikeLike
@grayshack Please see this post and check whether you can fix using those procedures https://suslovjb.wordpress.com/2014/01/03/android-novice-unable-to-build-android-project/
Can you provide me details on the error as this can be of several reasons? Also if possible clean and refresh the project and build again.
Make sure that you have imported the library project like the steps below
File > Import, select Android > Existing Android Code into Workspace
LikeLike
Thanks a lot! It’s THE good solution 😉
LikeLiked by 1 person
greyshack : I also faced the same problem , the solution that worked for me was like this :
Solution :
Error : First -> I got a red exclamation mark as u had got
Solution : I restarted the eclipse
Solved
Next, after removal of that mark when i tries adding it to my project I got the error of the project not opening because it was missing the “.project file” , i tried copying it from the folder to the project in eclipse but of no use
Solution : I deleted it and imported it again
Solved
Please let me know if this helped you
LikeLike
hello, help me please…
after imported google lay service then the values of google play service are error. how to fix them ? the message is :
google-play-services_lib\res\values-zu\strings.xml:18: error: Resource entry common_google_play_services_unsupported_title is already defined.
[2014-11-11 17:38:22 – TampilPeta] D:\Androidku\google-play-services_lib\res\values-zu\common_strings.xml:26: Originally defined here.
[2014-11-11 17:38:22 – TampilPeta] D:\Androidku\google-play-services_lib\res\values-zu\strings.xml:19: error: Resource entry common_google_play_services_unsupported_text is already defined.
[2014-11-11 17:38:22 – TampilPeta] D:\Androidku\google-play-services_lib\res\values-zu\common_strings.xml:27: Originally defined here.
LikeLike
@muhibun syairoji Check my post Step 2 > Point 4 and confirm whether any red cross symbols are shown ..
LikeLike
https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-xpf1/v/t1.0-9/11081002_537467359729914_1532621211207402725_n.jpg?oh=311675192d8050512419852394705059&oe=55A45598&__gda__=1436794354_468e84ddc4a239106f410e70915fb24e
i can’t selet the google-play-services_lib
https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-xfa1/v/t1.0-9/11102800_537542686389048_7356838298156842896_n.jpg?oh=d68d21ccc1ab8ad614c7ab484f881411&oe=5573C7AF&__gda__=1436520857_d8d4e39b1cd61f5c42d39182e2bd36c7
i am no idea…………
LikeLike
Hi.. please follow step 1 to point 3 of step 2.. i think you havent imported the play services to eclipse..
LikeLike
sir please send the url to download google play services
LikeLike
Hi Lakshmi.. Please use the below link to integrate play services to your android app.
https://developers.google.com/android/guides/setup
Please use Android Studio as IDE as that is the best path to move ahead with android development..
It will be great if you get some idea on gradle also.
LikeLike
thanks for it 🙂
after it i want to generate gradle file for android studio so i m exporting the project . in that when i select project it shows error like this.
Project../google_play_services/libproject/google_play_services_lib is missing. Needed by LocationDistanceTimeMapV2
LikeLiked by 1 person
Hi Dharmishtha,
Google play services library project will not be needed anymore in the case of android studio. Please do the below
1. Remove the play services library project dependency in gradle file (we dont need to link to library project anymore in android studio)
2. Remove the play services library project folder
3.Add the play services dependency just like in this link https://developers.google.com/android/guides/setup .
Hope this helps.
Cheers
LikeLike