Import Google Play Services library in Android Studio
Try this once and make sure you are not getting any error in project Structure saying that "ComGoogleAndroidGmsPlay not added"
Open File > Project Structure
and check for below all. If error is shown click on Red bulb marked and click on "Add to dependency".
This is a bug in Android Studio and fixed for the next release(0.4.3)
Android Studio Google-play-services library
In order to use that artifact, you need to install the "Google Repository" in the extras of the SDK manager, not "Google Play Services" as it sounds like you've done.
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
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:
Adding Google Play Services to gradle (Android Studio) does not work
I don't think version 27.0.0 exists the most recent version is 8.1.0
Related Topics
Java Doesn't Work with Regex \S, Says: Invalid Escape Sequence
Error Launching Android Studio: Failed to Create Jvm: Error Code-6
Change Listview Background - Strange Behaviour
Android: Email Client Receiver Email Id Empty in Android-Parse
Android Firestore Convert Array of Document References to List<Pojo>
Dynamically Get Drawables by Id
How to Connect Android with MySQL Using MySQL Jdbc Driver
How to Properly Use Backwards Compatible Vector Drawable with the Latest Android Support Library
Android Onconfigurationchanged Not Being Called
Android Classnotfoundexception
Java Lang Unsupportedclassversion Error in Xamarin Studio
Android: How to Parse Url String with Spaces to Uri Object
How to Execute JavaScript on Android
Convert Utc to Current Locale Time
Android Heterogeneous Gridview Like Pinterest
Concise Way of Writing New Dialogpreference Classes
Using Client/Server Certificates for Two Way Authentication Ssl Socket on Android