How to Fix Unity libil2cpp.so & libmain.so 16KB Page Size Error in Google Play
Unity mobile game developers uploading .aab files to Google Play Console frequently hit the "App does not support 16 KB memory page sizes" warning triggered by libil2cpp.so, libunity.so, or libmain.so. Here is the exact Unity Editor version matrix and NDK patch workflow to make your game compliant.
Not sure if a third-party Unity plugin (AdMob, Firebase, IronSource, or FMOD) is still compiled at 4 KB? Test your bundle right in your browser:
Open Unity 16KB Page Size Checker →1. Which Unity Versions Support 16 KB Page Sizes?
Unity precompiles libunity.so and libmain.so inside the Editor installation, while libil2cpp.so is compiled on your machine during the Android IL2CPP build step. You must use a patched Unity Editor release:
- Unity 6 (6000.0.23f1+): Full native 16 KB page support enabled out of the box.
- Unity 2022 LTS (2022.3.50f1+): Backported 16 KB ELF segment alignment for IL2CPP and Unity engine binaries.
- Unity 2021 LTS (2021.3.45f1+): Requires updating to the latest patch build and verifying custom native plugins.
2. Force 16 KB Linker Flags for Custom IL2CPP Builds
If you export a custom Gradle project or pass custom IL2CPP linker flags in C# editor scripts, ensure the linker aligns PT_LOAD segments on 0x4000 (16384-byte) boundaries:
// Assets/Editor/Android16kbLinkerFix.cs
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
public class Android16kbLinkerFix : IPreprocessBuildWithReport
{
public int callbackOrder => 0;
public void OnPreprocessBuild(BuildReport report)
{
if (report.summary.platform == BuildTarget.Android)
{
PlayerSettings.SetAdditionalIl2CppArgs("--linker-flags=\"-Wl,-z,max-page-size=16384\"");
}
}
}3. Check Third-Party Native Plugins in Assets/Plugins/Android
Even after upgrading Unity, precompiled .so or .aar files inside Assets/Plugins/Android (such as Google Mobile Ads, Unity LevelPlay, or custom audio engines) can still fail Google Play checks.
- Build your release
.aabfile in Unity. - Drop the
.aabinto the AABReady Unity 16KB Scanner. - Review every
arm64-v8a/*.soentry—any library showing4 KB (0x1000)must be updated via the External Dependency Manager for Unity (EDM4U).