Created
May 8, 2016 05:53
-
-
Save amit-cod/4a65fea60aa4a4a040f3439cc6ff3661 to your computer and use it in GitHub Desktop.
install google play services in android studio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add the correct dependencies into the build.gradle file: | |
All those answers are wrong, since the release of gradle plugin v0.4.2 the setup of google play services under android studio is straight forward. You don't need to import any jar or add any project library nor add any new module under android studio. What you have to do is to add the correct dependencies into the build.gradle file. Please take a look to those links: Gradle plugin v0.4.2 update, New Build System, and this sample | |
The Correct way to do so is as follows: | |
First of all you have to launch the sdk manager and download and install the following files located under "extras": Android support repository, Google play services, Google repository. | |
Restart android studio and open the build gradle file. You must modify your build.gradle file to look like this under dependencies: | |
``` | |
dependencies { | |
compile 'com.google.android.gms:play-services:6.5.87' | |
} | |
``` | |
Since version 6.5 you can include the complete library (very large) or just the modules that you need (Best Option). I.e if you only need Google Maps and Analytics you can replace the previous example with the following one: | |
``` | |
dependencies { | |
compile 'com.google.android.gms:play-services-base:6.5.87' | |
compile 'com.google.android.gms:play-services-maps:6.5.87' | |
} | |
``` | |
get complete list of modules under Google play services below: | |
https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment