Unity 2022.3.71F1 Android Playstore 16 KB Page Size not working

The issue

Google Play rejects the Android App Bundle (AAB) with an error that the app does not support 16 KB page sizes.

  • Context: From November 2025, Google Play requires apps targeting Android 15 (API 35) to support 16 KB memory page size on 64‑bit devices.

  • Project: Unity 2022.3.71f1, Android build (IL2CPP, AAB for Google Play), AR app.

  • Symptom: Upload to Play Console fails with a 16 KB page size compatibility error.


What we tried

  1. Legacy packaging workaround (no AGP upgrade)
  • In mainTemplate.gradle we added:

  • packagingOptions { jniLibs { useLegacyPackaging = true } }

  • So native libs are compressed and don’t need 16 KB alignment.

  • Result: Play still reported the same 16 KB error (workaround did not fix it).

  1. Upgrade to AGP 8.5.1 for proper 16 KB support
  • Added custom baseProjectTemplate.gradle with classpath ‘com.android.tools.build:gradle:8.5.1’.

  • Enabled Custom Base Gradle Template in Player Settings.

  • Result: Build failed because AGP 8.5.1 requires Gradle 8.7, while Unity was using its embedded Gradle 7.5.1 (gradle-launcher-7.5.1.jar). Error: “Minimum supported Gradle version is 8.7. Current version is 7.5.1.”

  1. Making Unity use Gradle 8.7
  • Post-generate script: Patched gradle-wrapper.properties in the generated project to request Gradle 8.7 (distributionUrl → gradle-8.7-all.zip).

  • Result: Unity does not use the project’s Gradle wrapper when building; it invokes the embedded Gradle launcher (7.5.1) directly, so the wrapper change had no effect.

  • Preprocess script: Before Android build, we tried to download Gradle 8.7, extract it to Library/Gradle87/, then set EditorPrefs: GradleUseEmbedded = false and GradlePath = that folder.

  • Result: Still not working for you (you reverted everything).

  1. Repository / settings warning
  • We saw: “Build was configured to prefer settings repositories over project repositories but repository ‘Google’ was added by build file ‘build.gradle’.”

  • We changed settingsTemplate.gradle from PREFER_SETTINGS to PREFER_PROJECT and kept repositories in the base template so the AGP could resolve.

  • This was only to fix the warning and allow the AGP 8.5.1 + Gradle 8.7 path to build; it doesn’t fix the 16 KB requirement by itself.

  1. Target SDK
  • We set Android Target SDK to 35 (Android 15) in Player Settings to align with the Play 16 KB requirement for apps targeting Android 15+.

Current situation

  • Unity 2022.3 ships with AGP 7.4.2 and Gradle 7.5.1 (embedded).

  • Google’s 16 KB requirement is met by using AGP 8.5.1+ (and thus Gradle 8.7+), which properly handles 16 KB alignment in the bundle.

  • The legacy packaging option (useLegacyPackaging = true) did not resolve the Play 16 KB error in our case.

  • So we’re stuck between: Unity’s fixed Gradle/AGP versions, and Play’s requirement for 16 KB support.


What we’re asking

  • Is there an official or recommended way in Unity 2022.3 LTS to build Android AABs that satisfy Google Play’s 16 KB page size requirement?

  • Has anyone successfully built a 2022.3 Android AAB that passes the 16 KB check, and if so, with which approach (e.g. custom Gradle path, export + external build, or a specific Unity/AGP/Gradle setup)?

  • Does Unity plan to update the default Android Gradle/AGP stack for 2022.3 (or document a supported path) for 16 KB compliance?

If you open your .apk with Android Studio it should tell you which libraries are not aligned to 16KB, but 4KB instead.

Could you share with us which libraries you are seeing as not aligned?