docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Get started with Android Resolver

    Configure and use the Android Resolver to manage Android library dependencies in your project.

    The Android Resolver copies specified dependencies from local or remote Maven repositories into the Unity project when you select Android as the build target in the Unity Editor.

    For example, to add the Google Play Games library (com.google.android.gms:play-services-games package) at version 24.0.0 to a plug-in's Android dependencies:

    <dependencies>
      <androidPackages>
        <androidPackage spec="com.google.android.gms:play-services-games:24.0.0">
          <androidSdkPackageIds>
            <androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
          </androidSdkPackageIds>
        </androidPackage>
      </androidPackages>
    </dependencies>
    

    The version specification element supports:

    • Specific versions, for example 24.00.
    • Partial matches, for example 24.0.+ matches 24.0.0, 24.0.1, and later versions.
    • Latest version using LATEST or +. Avoid LATEST unless you're confident updates to the library will not break your Unity plug-in.

    The previous example registers the dependency with the Android SDK Manager so it can install the package if it's missing. If your dependency is on Maven Central, declare it with the androidPackage element:

    <dependencies>
      <androidPackages>
        <androidPackage spec="androidx.appcompat:appcompat:1.7.1"/>
      </androidPackages>
    </dependencies>
    

    Configure auto resolution

    By default, the Android Resolver automatically monitors the dependencies you have specified and the Plugins/Android folder of your Unity project. The resolution process runs when the specified dependencies aren't present in your project.

    You can disable the auto resolution process in the Editor from Assets > External Dependency Manager > Android Resolver > Settings.

    To resolve Android dependencies manually:

    1. Select Resolve from the Assets > External Dependency Manager > Android Resolver menu.
    2. If the Resolve operation fails, select Assets > External Dependency Manager > Android Resolver > Force Resolve.

    Remove libraries

    The Android Resolver tracks resolved packages using asset labels. To remove resolved packages, navigate to Assets > External Dependency Manager > Android Resolver > Delete Resolved Libraries.

    Process Android manifest variables (deprecated)

    Important

    This feature is unsupported and will be removed in a future version of the package.

    Some Android Archive (AAR) files contain variables that the Android Gradle plug-in might normally process. Unity's Internal Build System doesn't perform that processing, so the Android Resolver unpacks the AAR into a folder and replaces ${applicationId} with the bundle ID where supported.

    You can disable AAR explosion and Android manifest processing in Assets > External Dependency Manager > Android Resolver > Settings menu. Disable AAR explosion if you export the project to build with Gradle or Android Studio.

    Strip ABIs (deprecated)

    Important

    This feature is unsupported and will be removed in a future version of the package.

    Some AAR files contain native libraries (.so files) for each Application Binary Interface (ABI) supported by Android. When targeting a single ABI (for example x86), Unity doesn't strip native libraries for unused ABIs. The Android Resolver can unpack the AAR and strip unused ABIs to reduce APK size. If libraries for multiple ABIs remain in the APK (for example, a mix of x86 and armeabi-v7a), Android can load the wrong library for the current ABI and break your plug-in on some devices.

    You can disable AAR explosion (and ABI stripping) in the Assets > External Dependency Manager > Android Resolver > Settings menu. Disable explosion if you export the project to build with Gradle or Android Studio.

    Choose a resolution strategy

    By default, the Android Resolver uses Gradle to download dependencies before integrating them into your Unity project.

    Change the resolution strategy in the Assets > External Dependency Manager > Android Resolver > Settings menu.

    Download artifacts with Gradle (deprecated)

    Important

    This method is deprecated and will be removed in a future version of the package.

    Using the default resolution strategy, the Android Resolver executes the following operations:

    1. Removes the result of previous Android resolutions. For example, delete all files and directories labeled with gpsr under Plugins/Android from the project.
    2. Collects the set of Android dependencies (libraries) specified by a project's *Dependencies.xml files.
    3. Runs download_artifacts.gradle with Gradle to resolve conflicts and, if successful, download the set of resolved Android libraries (AARs, JARs).
    4. Processes each AAR/JAR so that it can be used with the currently selected Unity build system (for example Internal versus Gradle, Export versus No Export). This involves patching each reference to applicationId in the AndroidManifest.xml with the project's bundle ID. This means resolution must be run again if the bundle ID has changed.
    5. Moves the processed AARs to Plugins/Android so they will be included when Unity invokes the Android build.

    Integrate into mainTemplate.gradle

    When the Patch mainTemplate.gradle setting is enabled, rather than downloading artifacts before the build, Android resolution results in the execution of the following operations:

    1. Remove the result of previous Android resolutions. For example, delete all files and directories labeled with gpsr under Plugins/Android from the project and remove sections delimited with // Android Resolver * Start and // Android Resolver * End lines.
    2. Collect the set of Android dependencies (libraries) specified by a project's *Dependencies.xml files.
    3. Rename any .srcaar files in the build to .aar and exclude them from being included directly by Unity in the Android build. mainTemplate.gradle will be patched to include them instead of using local maven repositories.
    4. Inject the required Gradle repositories into mainTemplate.gradle at the line matching the pattern .*apply plugin: 'com\.android\.(application|library)'.* or the section starting at the line // Android Resolver Repos Start. If you want to control the injection point in the file, place the section delimited by the lines // Android Resolver Repos Start and // Android Resolver Repos End in the global scope before the dependencies section.
    5. Inject the required Android dependencies (libraries) into mainTemplate.gradle at the line matching the pattern ***DEPS*** or the section starting at the line // Android Resolver Dependencies Start. If you want to control the injection point in the file, place the section delimited by the lines // Android Resolver Dependencies Start and // Android Resolver Dependencies End in the dependencies section.
    6. Inject the packaging options logic, which excludes architecture specific libraries based upon the selected build target, into mainTemplate.gradle at the line matching the pattern android +{ or the section starting at the line // Android Resolver Exclusions Start. If you want to control the injection point in the file, place the section delimited by the lines // Android Resolver Exclusions Start and // Android Resolver Exclusions End in the global scope before the android section.

    Tracck dependencies

    The Android Resolver creates the ProjectSettings/AndroidResolverDependencies.xml file to record the set of resolved dependencies in a project. Auto-resolution uses this file to decide when to run resolution again.

    View resolved dependencies

    To view a list of the dependencies the Android Resolver has resolved in your project, navigate to Assets > External Dependency Manager > Android Resolver > Display Libraries.

    Additional resources

    • Android Resolver settings reference
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)