Appearance
Appearance
The External Dependency Manager for Unity (EDM4U) is a package manager for Android-native .aar
library dependencies. The EDM4U automatically downloads all necessary packages and resolves any version conflicts, and MetaplaySDK uses EDM4U to manage Android dependencies. The EDM4U is not bundled into the MetaplaySDK and may require manual installation for successful Android builds. This document describes the necessary installation steps.
Many Google packages, such as for Firebase, automatically bundle EDM4U, making it almost always present in any Android-targeting project. To check if EDM4U is already installed, switch Unity project plaform to Android and look into the application menu bar. If Menu > Assets > External Depenency Manager exists, the EDM4U is succesfully installed.
If EDM4U is not already installed, you can install it manually. EDM4U is delivered as a Unity Package Manager package, but it's not in available in Unity's repository. To install the package manually:
.tgz
file from Google APIs for Unity and place it in Packages/
directory.Note that Unity Package Manager UI may automatically use absolute paths in Packages/manifest.json
. To avoid issues with version control and different paths with different users, convert the path to the relative form, such as file:com.google.external-dependency-manager-1.2.172.tgz
if the .tgz
file is placed in Packages/
directory.
Alternatively, you may follow the official instructions for installing the package using OpenUPM.
Upon installation, the EDM4U will perfom package resolution and will download necessary Android libraries to the Assets/Plugins/Android
directory. It is convenient to commit these libraries into the version control.
💡 Manual Dependency Management
If the automatic dependency resolution of EDM4U is not suitable and you need to manage Android dependencies manually, you do so by defining METAPLAY_DISABLE_GOOGLE_EDM4U_CHECK
symbol. This disables the safety check in MetaplaySDK which checks that EDM4U has been installed when building for Android.
EDM4U interacts with Android's Gradle build system, which requires precise Java JDK versions to be used. The version used should be the Unity Editor's bundled JDK version. The Unity Editor, EDM4U and Gradle may sometimes get confused of and use the current JDK version installed on the developer's computer. In this case, the resolution and may fail with the following error message:
Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
This can be resolved by resetting the JDK version in Unity: