Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Google Play services to my Eclipse ADT project

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

enter image description here

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:

enter image description here

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

enter image description here

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?

like image 381
Jaime Montoya Avatar asked Dec 23 '22 19:12

Jaime Montoya


2 Answers

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:

enter image description here

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:

enter image description here

The error is fixed for me now:

enter image description here

like image 95
Jaime Montoya Avatar answered Mar 03 '23 19:03

Jaime Montoya


You can also use the latest versions of GPS with Eclipse ADT. With version 68 of the Google Repository downloaded via SDK Manager from Studio, navigate to $ANDROID_SDK_ROOT/extras/google/m2repository/com/google/android/gms. For each service needed, go to subdirectory #PLAY_SERVICE_NEEDED#/$VERSION and extract the contained AAR file (which is just a zip file). Within the AAR, you will find classes.jar, a manifest and res(sources) from which you can make an ADT compatible library project.

like image 27
step_jac Avatar answered Mar 03 '23 17:03

step_jac