How to add Google Play services to my Eclipse ADT project
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:
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:
The error is fixed for me now:
is there any way to add google play services 9.0.2 to an Eclipse project?
You can use it, i used Google Play Services (r29) in my recent app, because latest one and the one you mention will be of no use in Eclipse as it will lack libProjects which we import as a library to use in our Application Project and integer value of Google Services version which we have to use in Android Manifest under <meta-data />
Steps to do :
1- Download Google Play Services (r29) rev30+ will have just documentation and sample projects which are of no use.
2- Unzip downloaded rar and paste in directory X:\yourSDKdirectory\android-sdk\extras\google\google_play_services\
3- Go to Eclipse File->Import->Existing Android Code->android-sdk\extras\google\ google_play_services\libproject
4- Now you can use this project as library in your Android Application Project.
5- In Android Manifest after <application >
tag
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Hope this helps.!
Short Advice:
It is better to switch to Android Studio, despite all hate i have against Android Studio, i had to switch, it is better in some ways but in most, it is literally crap as compared to Eclipse. But with little tweaks and management you will find it smooth but still irritating, well switch to it, after 4~5 years it might become as efficient and optimized as Eclipse :D
2.2 (Preview 6 is quite good, 7 is out though)
Add Google Play Services to Eclipse project
I found that the play services libproject has to be imported onto the same physical drive as your project. (check the 'Copy projects into workspace' checkbox when you import)
Add Google Play Service into eclipse workspace Android
When you have imported your Google_play_services_lib in your project you have to enable your "Copy to WorkSpace" checkbox. So you can find that library project in Eclipse. After that you have to go to
Right click on project -> Go to properties -> Click on Android from left bar -> Add Library -> Click there you will find google_play_service_lib -> Click Apply and ok.
So it will be added as a library project to your project.
Second option is that you can import GoogleAdMobAdsSdk-6.4.1.jar jar file into your libs folder.
Getting error when import Google Play services errors in Android Studio
Based from Setting Up Google Play Services:
To develop an app using the Google Play services APIs, you need to set up your project with the Google Play services SDK. If you haven't installed the Google Play services SDK yet, go get it now by following the guide to Adding SDK Packages.
Here are the steps to make the Google Play services API available to your app in Android Studio:
1. Open the build.gradle file inside your application module directory.
Note: Android Studio projects contain a top-level build.gradle file and a build.gradle file for each module. Be sure to edit the file for your application module. See Building Your Project with Gradle for more information about Gradle.
2. Add a new build rule under dependencies for the latest version of play-services. For example:
apply plugin: 'com.android.application'
...
dependencies {
compile 'com.google.android.gms:play-services:10.0.1'
}
Be sure you update this version number each time Google Play services is updated.
3. Save the changes and click Sync Project with Gradle Files in the toolbar.
You can now begin developing features with the Google Play services APIs.
For additional information, you may also visit the following links:
- Gradle Plugin User Guide
- Android Studio with Google Play Services
- eclipse android can not import google play services library
Related Topics
Google Play Security Alert - Your App Is Using an Unsafe Implementation of the Hostnameverifier
Trying to Uninstall_Shortcut But Shortcut Won't Go Away
Android: Backspace in Webview/Baseinputconnection
Android - Gettargetfragment and Settargetfragment - What Are They Used For
Android: Simulate Wifi in the Emulator
Android Drawerlayout - No Drawer View Found with Gravity
Cannot Start Activity Background in Android 10 [ Android Q ]
How to Play an Mp3 in the Res/Raw Folder of My Android App
How to Create Parallelogram Shape Background
Broadcastreceiver as Inner Class
Check If User Is Authenticated for the First Time in Firebase Google Authentication in Android
How to Tell If the Screen Is on in Android
How to Pass a File Path Which Is in Assets Folder to File(String Path)
Android Google Maps API V2 Zoom to Current Location
Why Does Gradle Build My Module in Release Mode When the App Is in Debug