The Google Play Plugins for Unity provide C# APIs for accessing various Play services at runtime from within the Unity Engine. These plugins also provide various Unity Editor features for building an app that can be published on Google Play Console.
These plugins support Unity 2018.4 or later, as well as Unity 2017.4.40.
Note: some features depending on async tasks are only available on Unity 2018.4 or later.
Support for older versions of Unity (including 5.6) was removed after version 1.4.0 because Google Play requires that apps published with 32 bit native libraries also provide 64 bit native libaries.
There are 3 different options for obtaining the plugins:
-
Download individual plugins as
.unitypackage
files or Unity Package Manager (.tgz
) files from Google APIs for Unity -
Download the latest release from this project's releases page
-
git clone
this repository into the Assets folder of your Unity project
For all cases except git clone
follow the instructions to
Install Google packages for Unity.
Developers using git clone
must also install the External Dependency Manager for Unity (EDM4U) using either the .tgz or .unitypackage available on the Google APIs for Unity archive page.
If EDM4U is not installed, the project won't be able to fetch necessary Java dependencies such as the Play Core library, resulting in runtime errors.
These plugins add features, such as Google Play Instant support, to a Unity project.
com.google.android.appbundle
The Google Android App Bundle package provides access to the latest Android App Bundles features, such as Play Asset Delivery.
Refer to the documentation and Editor API reference for more information.
com.google.play.assetdelivery
Play Asset Delivery enables AssetBundles and other assets to be packaged into an Android App Bundle and delivered through Google Play.
Refer to the documentation and Runtime API reference for more information.
com.google.play.review
Play In-App Review lets you prompt users to submit Play Store ratings and reviews without the inconvenience of leaving your game.
Refer to the documentation and Runtime API reference for more information.
com.google.play.appupdate
Play In-App Update lets you keep your app up-to-date on your users’ devices and enables them to try new features, as well as benefit from performance improvements and bug fixes.
Refer to the documentation and Runtime API reference for more information.
com.google.play.instant
The Google Play Instant package simplifies the conversion of an Android app into an instant app that can be deployed through Google Play.
Refer to the documentation, Runtime API reference, and Editor API reference for more information.
com.google.play.integrity
The Play Integrity API helps protect your apps and games from potentially risky and fraudulent interactions, allowing you to respond with appropriate actions to reduce attacks and abuse such as fraud, cheating, and unauthorized access.
Refer to the documentation and Runtime API reference for more information.
These plugins provide shared functionality to some of the above plugins, but they don't provide any features when installed separately.
com.google.play.common
The Google Play Common package provides common files required by some Google Play packages, such as Play Instant.
com.google.play.core
The Google Play Core package provides the Play Core Library required by some Google Play packages, such as Play Asset Delivery.
com.google.play.billing
The Google Play Billing Plugin for Unity will not be receiving updates going forward. This means that it will stay on Play Billing Library 3 and app updates past Nov 1, 2022 will no longer be able to use the plugin.
Package contains Google Play Billing Library, which is required to sell digital content and subscriptions in games distributed via Google Play. This new version of the Google Play Billing Library provides all of the features available in the current Java and Kotlin versions.
To use this package, you must agree to the licenses for this Google Play Plugin and the Google Play Billing Library. If you do not agree with the licenses, you may not use this package.
Refer to the documentation and Runtime API reference for more information.
Recent versions of Unity, such as 2019.4.29, 2020.3.15, and 2021.1.15 (or later), include built-in support for Play Asset Delivery (PAD). These Unity versions allow developers to specify asset packs by placing assets in .androidpack folders within their project. These versions also change the "Split Application Binary" option to use asset packs instead of OBBs.
The build method used by the Google Play Plugins for Unity is incompatible with these features and will ignore assets placed in the .androidpack folders.
When building an Android App Bundle with Unity's build system (e.g. "File > Build and Run"), Unity may include the monolithic Play Core library in a way that causes conflicts with the new Play libraries included by Google Play Plugins for Unity.
To resolve these conflicts, follow the steps below:
- Enable "Custom Main Gradle Template" in "Android Player > Publishing Settings"
- Enable "Patch mainTemplate.gradle" in "Assets > External Dependency Manager > Android Resolver > Settings"
- Include this empty monolithic Play Core library as a local maven repository
These steps will allow EDM4U to update the mainTemplate.gradle to include the empty monolithic Play Core library as a gradle dependency. This will override the version of the Play Core library included by Unity and resolve the duplicate class errors and manifest merger failures.
The Google Play Plugins for Unity may collect version related data to allow Google to improve the product, including:
- App’s package name
- App’s package version
- Google Play Plugins for Unity's version
This data will be collected when you upload your app package
to the Play Console. To opt-out of this data collection process, remove the packagename.metadata.jar
file found under each plugin's Runtime/Plugins
folder.
Note, this data collection related to your use of the Google Play Plugins for Unity and Google’s use of the collected data is separate and independent of Google’s collection of library dependencies declared in Gradle when you upload your app package to the Play Console.
The Google Play Games plugin for Unity enables access to the Google Play Games APIs from Unity.
The External Dependency Manager for Unity provides tools for handling dependencies such as Android libraries (AARs) and iOS CocoaPods. The Google Play Plugins for Unity depend on EDM4U to resolve AAR dependencies such as the Play Core library.