Google is committed to advancing racial equity for Black communities. See how.

Including Open Source Notices

It is up to every developer to appropriately display the notices to comply with the license requirements of open source libraries. Google Play services sometimes includes, or depends upon, open source libraries.

As of version 11.2.0, Google Play services includes a set of tools designed to give developers an easier way to express the open source software notices of libraries used in their apps. It includes a Gradle plugin that collects license terms from included libraries as declared in their POM files and an Activity that can be used to display these terms.

Add the Gradle plugin

In your root-level build.gradle make sure you are using the Google Maven repository and add the oss-licenses plugin to your dependencies:

buildscript {
  repositories {
    // ...
    google()  // maven { url "" } for Gradle <= 3
  dependencies {
    // ...
    // Add this line:
    classpath ''

In your app-level build.gradle, apply the plugin by adding the following line under the existing apply plugin: '' at the top of the file:

apply plugin: ''

This plugin's code is available on GitHub.

Add the library to your app

In the dependencies section of your app-level build.gradle, add a dependency on the oss-licenses library:

implementation ''

Displaying license information

When the application builds, the Gradle plugin will process the licenses and add them to the app resources. To easily display them you can trigger an activity provided by the play-services-oss-licenses library at an appropriate point in your app:


// ...

// When the user selects an option to see the licenses:
startActivity(new Intent(this, OssLicensesMenuActivity.class));

This will display a list of open source libraries that are compiled into the app, whether part of Google Play services or not. Tapping the library name will display additional license information for that library.

Setting the Activity title

You can also set the title of the displayed activity:


How licenses are determined

The Gradle plugin scans the POM dependencies of the project at compile time. When a Maven POM exists for a direct dependency of the app, the plugin processes the <licenses> element and embeds the link and title of each license in an Android asset in the final app APK.