Set up Google Play services

To develop an app using Google Play services APIs, follow the instructions on this page to set up your project with the relevant SDKs, which are available from the Google maven repository.

To test your app when using Google Play services, you must use one of the following:

  • A compatible Android device that runs Android 6.0 (API level 23) or higher and has the Google Play Store app installed.
  • The Android emulator with an AVD that runs the Google APIs platform based on Android 6.0 (API level 23) or higher.

Declare dependencies for Google Play services

To develop features that depend on the Google Play services APIs in your app, complete the following steps:

  1. Open the build.gradle file inside your app's module directory.

  2. For each SDK that your app requires, include the dependency for that SDK. This page includes a section that lists common Google Play services dependencies for Android apps. You might also want to add Firebase dependencies to your project.

  3. Save the changes and sync your project.

The following snippet shows an example build.gradle file that uses the location library:

apply plugin: 'com.android.application'

...

dependencies {
    implementation 'com.google.android.gms:play-services-location:21.3.0'
}

New versions of the Google Play services SDKs with bug fixes and new features are periodically released. These updates are announced in the release notes. If your app uses a dependency that has been updated, change to the latest version in your app's dependencies to take advantage of these fixes.

Check whether Google Play services is installed

As described in the Google Play services overview, Google Play services receives automatic updates on Android 6.0 (API level 23) and higher through the Google Play Store app. However, Android devices without Google Play Store don't have Google Play services installed. If your app runs on devices without Google Play services, you might want to check to see if Google Play services is installed on the device before you attempt to use Google APIs, or enable features in your app that require Google Play services to function.

To check for the presence of Google Play services on the device, use the isGooglePlayServicesAvailable() method.

To then begin a connection to Google Play services, or learn how to detect whether the version of Google Play services installed supports a specific API, read the guide on Accessing Google APIs.

Google Play services dependencies

The following table lists the dependencies for Google Play services that you can include in your Android app. You can filter the list by device type by selecting one of the buttons, and you can search for a specific use case or dependency name by entering text into the box that appears after the buttons.

Table 1. Google Play services dependencies to include in Android apps
Use case and dependency name Supported devices
Google Mobile Ads
com.google.android.gms:play-services-ads:23.5.0
Phone, Tablet
Android Advertising ID (AAID)
com.google.android.gms:play-services-ads-identifier:18.1.0
Phone, Tablet, Android TV, ChromeOS
Lightweight version of Google Mobile Ads
com.google.android.gms:play-services-ads-lite:23.5.0
Phone, Tablet
AdSense for Search (AFS) Custom Search Ads (CSA)
com.google.android.gms:play-services-afs-native:19.1.0
Phone, Tablet, ChromeOS
Google Analytics Services SDK for Android
com.google.android.gms:play-services-analytics:18.1.1
Deprecated. Use Google Analytics for Firebase instead.
App Index
com.google.android.gms:play-services-appindex:16.2.0
Phone, Tablet, Android TV
AppSearch
com.google.android.gms:play-services-appsearch:16.0.1
Phone, Tablet, Android TV
Android App Set ID
com.google.android.gms:play-services-appset:16.1.0
Phone, Tablet, Android TV, ChromeOS
Google Sign-In for Android
com.google.android.gms:play-services-auth:21.2.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS
SMS Retriever API
com.google.android.gms:play-services-auth-api-phone:18.1.0
Phone, Tablet, Android Go
Block Store API (includes user credential storage)
com.google.android.gms:play-services-auth-blockstore:16.4.0
Phone, Tablet, Android Go, ChromeOS
Google Awareness API
com.google.android.gms:play-services-awareness:19.1.0
Phone, Tablet, Auto, Android Go, ChromeOS
Utility classes
com.google.android.gms:play-services-base:18.5.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS, Wear OS
Testing fakes for utility classes
com.google.android.gms:play-services-base-testing:16.1.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS, Wear OS
More utility classes
com.google.android.gms:play-services-basement:18.5.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS, Wear OS
Google Cast
com.google.android.gms:play-services-cast:22.0.0
Phone, Tablet, Android Go, ChromeOS
Google Cast Application Framework (CAF)
com.google.android.gms:play-services-cast-framework:22.0.0
Phone, Tablet, Android Go, ChromeOS
Google Code Scanner
com.google.android.gms:play-services-code-scanner:16.1.0
Phone, Tablet, Android Go, ChromeOS
Chromium network stack (Cronet)
com.google.android.gms:play-services-cronet:18.1.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS, Wear OS
Device-to-device interactions (DTDI)
com.google.android.gms:play-services-dtdi:16.0.0-beta02
Phone, Tablet, Android Go
Fast IDentity Online (FIDO) Authentication
com.google.android.gms:play-services-fido:21.1.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS, Wear OS

Supported on devices that run Android 7.0 (API level 24) or higher.
Google Fit API for Android and Recording API on mobile (for user fitness data)
com.google.android.gms:play-services-fitness:21.2.0
Phone, Tablet, Android Go, ChromeOS, Wear OS
Google Play Games Services v2 for Android
com.google.android.gms:play-services-games-v2:20.1.2
Phone, Tablet, Android TV, Android Go, ChromeOS
Google Play Games Services v2 Native C SDK for Android
com.google.android.gms:play-services-games-v2-native-c:17.0.0-beta1
Phone, Tablet, Android TV, Android Go, ChromeOS
Google Play Games Services v1 for Android
com.google.android.gms:play-services-games:23.2.0
Phone, Tablet, Android TV, Android Go, ChromeOS
Matter API
com.google.android.gms:play-services-home:16.0.0
Phone, Tablet
Google Play Instant
com.google.android.gms:play-services-instantapps:18.1.0
Phone, Tablet, Android TV, Android Go, ChromeOS

Supported on devices that run Android 5.0 (API level 21) or higher.
Location Services for Android
com.google.android.gms:play-services-location:21.3.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS, Wear OS
Google Maps SDK for Android
com.google.android.gms:play-services-maps:19.0.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS, Wear OS
ML Kit barcode scanning
com.google.android.gms:play-services-mlkit-barcode-scanning:18.3.1
Phone, Tablet, Android Go, ChromeOS
ML Kit document scanner
com.google.android.gms:play-services-mlkit-document-scanner:16.0.0-beta1
Phone, Tablet, Android Go, ChromeOS
ML Kit face detection
com.google.android.gms:play-services-mlkit-face-detection:17.1.0
Phone, Tablet, Android Go, ChromeOS
ML Kit image labeling
com.google.android.gms:play-services-mlkit-image-labeling:16.0.8
Phone, Tablet, Android Go, ChromeOS
ML Kit image labeling custom
com.google.android.gms:play-services-mlkit-image-labeling-custom:16.0.0-beta5
Phone, Tablet, Android Go, ChromeOS
ML Kit language identification
com.google.android.gms:play-services-mlkit-language-id:17.0.0
Phone, Tablet, Android Go, ChromeOS
ML Kit smart reply
com.google.android.gms:play-services-mlkit-smart-reply:16.0.0-beta1
Phone, Tablet, Android Go, ChromeOS
ML Kit subject segmentation
com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1
Phone, Tablet, Android Go, ChromeOS
ML Kit text recognition
com.google.android.gms:play-services-mlkit-text-recognition:19.0.1
Phone, Tablet, Android Go, ChromeOS
ML Kit text recognition for Chinese
com.google.android.gms:play-services-mlkit-text-recognition-chinese:16.0.1
Phone, Tablet, Android Go, ChromeOS
ML Kit text recognition for Devanagari
com.google.android.gms:play-services-mlkit-text-recognition-devanagari:16.0.1
Phone, Tablet, Android Go, ChromeOS
ML Kit text recognition for Japanese
com.google.android.gms:play-services-mlkit-text-recognition-japanese:16.0.1
Phone, Tablet, Android Go, ChromeOS
ML Kit text recognition for Korean
com.google.android.gms:play-services-mlkit-text-recognition-korean:16.0.1
Phone, Tablet, Android Go, ChromeOS
Nearby device discovery and connection
com.google.android.gms:play-services-nearby:19.3.0
Phone, Tablet, Android TV, Auto, Android Go
Show open-source licenses
com.google.android.gms:play-services-oss-licenses:17.1.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS
Supported on devices that run Android 5.0 (API level 21) or higher.
Programmatic Access Libraries (PAL)
com.google.android.gms:play-services-pal:21.0.0
Phone, Tablet, Android TV
Supported on devices that run Android 5.0 (API level 21) or higher.
Screen lock quality check
com.google.android.gms:play-services-password-complexity:18.1.0
Phone, Tablet, Android Go, ChromeOS, Wear OS

Supported on devices that run Android 4.4 (API level 19) to Android 9 (API level 28).
Google Wallet (formerly Google Pay for Passes)
com.google.android.gms:play-services-pay:16.5.0
Phone, Tablet, Android Go, ChromeOS

Supported on devices that run Android 5.0 (API level 20) or higher.
reCAPTCHA Enterprise for app instrumentation
com.google.android.gms:play-services-recaptcha:17.1.0
Phone, Tablet, Android TV, Android Go, ChromeOS
SafetyNet APIs (includes device attestation, safe browsing, reCAPTCHA, and app verification)
com.google.android.gms:play-services-safetynet:18.1.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS
Google Tag Manager
com.google.android.gms:play-services-tagmanager:18.1.1
Phone, Tablet, Android TV, Android Go, ChromeOS
Tasks API on Android
com.google.android.gms:play-services-tasks:18.2.0
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS, Wear OS
Acceleration Service for Android
com.google.android.gms:play-services-tflite-acceleration-service:16.3.0-beta01
Phone, Tablet, Android Go, ChromeOS
TensorFlow Lite GPU Delegate API for Google Play services
com.google.android.gms:play-services-tflite-gpu:16.3.0
Phone, Tablet, Android Go, ChromeOS
TensorFlow Lite Java API for Google Play services
com.google.android.gms:play-services-tflite-java:16.3.0
Phone, Tablet, Android Go, ChromeOS
TensorFlow Lite Support API for Google Play services
com.google.android.gms:play-services-tflite-support:16.3.0
Phone, Tablet, Android Go, ChromeOS
Thread Network API
com.google.android.gms:play-services-threadnetwork:16.2.1
Phone, Tablet
Mobile Vision
com.google.android.gms:play-services-vision:20.1.3
Phone, Tablet, Android Go, ChromeOS
Google Pay for Payments on Android
com.google.android.gms:play-services-wallet:19.4.0
Phone, Tablet, Auto, Android Go, ChromeOS, Wear OS
Wearable Data Layer API
com.google.android.gms:play-services-wearable:19.0.0
Phone, Tablet, Wear OS

Gradle plugins

Google Play services also includes several Gradle plugins, as shown in the following table. Note that the buttons that appear before the previous table don't change the information that appears in this table.

Table 2. List of Gradle plugins included in Google Play services
Use case and Gradle plugin name Supported devices
Show open-source licenses
com.google.android.gms:oss-licenses-plugin:0.10.6
Phone, Tablet, ChromeOS
Strict version checking
com.google.android.gms:strict-version-matcher-plugin:1.2.4
Phone, Tablet, Android TV, Auto, Android Go, ChromeOS, Wear OS