[Android] Gradle 9.1.0 & AGP 9.0.0 Update in Unity 6.0+

Overview

Unity 6.3+ features an update to its Android build tooling, moving to Gradle 9.1.0 (from 8.13) and to Android Gradle Plugin (AGP) 9.0.0 (from 8.10.0).

While we aim to keep build dependencies as stable as possible, staying current with Android’s ecosystem is vital for security, performance, and long-term compatibility with the Play Store. This update ensures that Unity’s Android builds remain modern and reliable.

What does this mean for you?

For the majority of projects, this change happens entirely under the hood. However, if you use custom Gradle templates (mainTemplate.gradle, launcherTemplate.gradle) or rely on older third-party plugins, you may need to make a few manual adjustments to avoid build errors.

Timeline

This update is currently scheduled to land in:

Unity Version Release Date
6000.5.0a7+ Released: February 18, 2026
6000.4.4f1 Released: April 24, 2026
6000.3.17f1 Released: June 5, 2026
6000.0.79f1 Expected: July 10, 2026

Migration

Because AGP 9.0.0 removes several older attributes, your build might throw warnings or fail if your custom scripts still reference them. In most cases, Unity will automatically try to solve these issues for you when building your project.

Key changes to look out for:

  • Property Removals: Attributes like targetSdkVersion, minSdkVersion, lintOptions, and packagingOptions have been removed from the Gradle DSL. These should now be handled via their modern equivalents. This is automatically handled by the Gradle Template Updater.
  • ProGuard Updates: AGP 9.0.0 replaces proguard-android.txt for the optimized version: proguard-android-optimize.txt. Using the old proguard-android.txt is not allowed anymore.
  • API changes: If you have custom logic in .gradle templates, make sure you check out the deprecated API from the official AGP release notes.
  • Unique namespaces: Make sure any custom Android plugin or .androidlib in your project has a unique namespace or package name. You can set this in either:
    • AndroidManifest.xml using package="com.example.library.unique" or
    • The build.gradle file of that library using namespace "com.example.library.unique".

What you should do:

  1. Check your templates: If you have “Custom Gradle Template” enabled in Player Settings, review your .gradle files for any of the removed attributes listed above. If you’re using any removed attributes, Unity will display a dialog on build and automatically rename them to use the newer version of these attributes.
  2. Update Plugins: Check for updates from third-party SDK providers (Ads, Analytics, etc.) to ensure they support AGP 9.0.

Additional resources

Known issues

— The Android Platform Team @Unity

10 Likes

Thanks for this team! This actually saves lot of support requests :slight_smile:
Will give a try!

Cheers,
VB Team

1 Like

Changing the namespace in the AndrodManifest.xml gives this error on build

Incorrect package="com.google.unity.ads.unique" found in source AndroidManifest.xml: C:\xxxx\unityLibrary\GoogleMobileAdsPlugin.androidlib\AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.google.unity.ads.unique" from the source AndroidManifest.xml:

It seems that updating it in the build.gradle is now the only viable option and should be the recommended approach moving forward.

…but the problem is that :unityandroidpermissions: nor :arcore_client: is my custom plugin. So how do I make sure that “all modules and libraries have a unique namespace”? How do I fix this error?

> Task :launcher:processDebugMainManifest FAILED
[:unityandroidpermissions:] /Users/.../.gradle/caches/9.1.0/transforms/cb80e2df6de30f2cd712379ad0fa0545/transformed/jetified-unityandroidpermissions/AndroidManifest.xml Error:
	Namespace 'com.google.ar.core' is used in multiple modules and/or libraries: :unityandroidpermissions:, :arcore_client:. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace
/Users/.../Projects/.../...-droid264/launcher/src/main/AndroidManifest.xml Error:
	Validation failed, exiting

Hey @mwalus, sorry that you are encountering that issue. The XR team fixed it in 6.5.0-pre.3 (Changelog | AR Foundation | 6.5.0).

Can you trying updating that package and seeing if that fixes your issue?

2 Likes

Ohhhh yesss… after updating ARFoundation packages to 6.5.0 it builds correctly :white_check_mark:

Thanks for info! :folded_hands:

2 Likes

Will older Unity LTS versions also get backported support for Gradle 9 / AGP 9 later, or stay on 8?

Yes! We plan to update Gradle in 6.3 and 6.0 as well. You can subscribe to this thread to get notified when those update land.

2 Likes

Awesome thank you!

I got this error when build using Unity 6000.3.18f1 with AGP upgrade from 8.7.2 to 9.0.0

Error:
Namespace ‘com.appsflyer’ is used in multiple modules and/or libraries: com.appsflyer:purchase-connector:2.2.0, com.appsflyer:af-android-sdk:6.18.0. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace
/Users/admin/Working/_blank/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/src/main/AndroidManifest.xml Error:
Validation failed, exiting

Im using Appsflyer 6.18.1 and EDM4U 1.2.186 install via UPM from this

“scopedRegistries”: [
{
“name”: “package.openupm.com”,
“url”: “https://package.openupm.com”,
“scopes”: [
“com.gemserk.selectionhistory”,
“com.google.external-dependency-manager”
]
}
]

It able to build if i remove this line in AppsFlyerDependencies.xml
<androidPackage spec="com.appsflyer:purchase-connector:2.2.0"></androidPackage>
but it make Appsflyer not working with Purchase Connector.

It also able to build if use unity 6000.3.18f1 with AGP 8.7.2

here is bug detail i posted in repo of jar resolver

I’d say the issue is in the AppsFlyer SDK. Check if there’s a new version or report a bug for them.

As @IGuscin said, the issue seems to be in the Applfyer library. Please, report he issue in their repo AppsFlyerSDK/appsflyer-unity-plugin , or try updating that dependency to see if they have fixed it in newer versions.