
Fix 'Recompile your app with 16KB native library alignment' Warning in Play Console
A complete guide to solve the 16KB alignment warning for Android apps
When you upload your Android App Bundle (AAB) or APK to the Google Play Console, you may encounter the warning:
⚠️ “Recompile your app with 16KB native library alignment.”
This message can confuse developers, especially those using frameworks like Unity, React Native, Flutter, or Expo. But once you understand what it means, the fix is straightforward. Let’s break it down and see how to solve it.
📌 What Does This Warning Mean?
Starting with Android 12 (API level 31), Google Play requires that native libraries (.so files) are aligned at 16KB.
This improves:
✅ Performance → Faster loading of libraries
✅ Security → Consistent memory alignment
✅ Future compliance → Google Play may block apps that don't meet this requirement in future updates
Apps built with older versions of the Android Gradle Plugin (AGP), NDK, or frameworks like Unity, React Native, Flutter, or Expo may still produce libraries aligned at 4KB, triggering this warning.
🚀 How to Fix the Warning
1️⃣ Update Android Gradle Plugin (AGP) & Gradle
Upgrading your build tools usually solves the issue.
In your project-level build.gradle:
classpath "com.android.tools.build:gradle:7.2.2"
In gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
Then, run:
./gradlew clean build
2️⃣ Update the NDK (If You Use Native Code)
If your project includes C/C++ code:
- Upgrade to NDK r23b or later
- In your build.gradle:
android {
defaultConfig {
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
}
3️⃣ Unity Developers – Fix Alignment in Unity Apps
If you’re using Unity, this warning may appear because of how native libraries are bundled.
Steps to fix:
✔ Upgrade to Unity 2021.3 LTS or newer – these versions already align libraries to 16KB.
✔ If you're using older versions, rebuild using the latest Gradle export rather than exporting APKs directly.
✔ Verify that build.gradle uses AGP 7.2+ and NDK r23b or later.
Many developers searching for “unity recompile your app with 16 kb native library alignment” face this issue, and following these steps resolves it.
4️⃣ React Native Developers – Align Native Libraries in React Native
React Native apps with native modules may also trigger this warning.
Steps to fix:
✔ Upgrade to the latest react-native version.
✔ Ensure your android/build.gradle, gradle.properties, and app/build.gradle files reference AGP 7.2+ and Gradle 7.5+.
✔ Run:
cd android
./gradlew clean
./gradlew build
✔ Check all plugins that include .so libraries and update them if necessary.
This helps fix problems for developers searching “react native recompile your app with 16 kb native library alignment”.
5️⃣ Flutter Developers – Solve 16KB Alignment in Flutter Apps
For Flutter projects, especially those with plugins using native libraries:
✔ Use Flutter 3.x or newer, where alignment issues are fixed.
✔ Run flutter clean and rebuild with:
flutter build appbundle --release
✔ Ensure android/build.gradle uses AGP 7.2+ and Gradle 7.5+.
✔ Check third-party plugins for outdated .so files.
Flutter developers encountering “flutter recompile your app with 16 kb native library alignment” will find this solution useful.
6️⃣ Expo Developers – Handle Alignment Issues in Expo Apps
For Expo projects:
✔ In the bare workflow, update native modules to use AGP 7.2+ and NDK r23b or later.
✔ In the managed workflow, upgrade to the latest Expo SDK, where alignment is handled.
✔ Rebuild using expo run:android or other supported commands after upgrading.
This addresses concerns from developers searching “expo recompile your app with 16 kb native library alignment”.
7️⃣ Manual Workaround with zipalign (Not Recommended)
If you cannot immediately upgrade your build tools, you can temporarily align libraries using zipalign:
zipalign -p -f -v 4096 app-release.aab app-fixed.aab
⚠️ Important:
Standard zipalign only aligns at 4KB, not 16KB. This workaround is temporary, and the only reliable fix is updating your build environment.
❓ Common Questions About 16KB Alignment
Q: Why does this warning appear in Play Console?
It’s because your app’s native libraries are aligned at 4KB instead of the required 16KB for Android 12 and newer.
Q: Does this affect apps built with Unity, React Native, Flutter, or Expo?
Yes! Any framework using native code or libraries can trigger this warning if outdated versions are used.
Q: Can I fix it without updating the whole app?
Only temporarily using zipalign. The permanent solution is upgrading AGP, Gradle, NDK, or your framework version.
Q: Will my app be blocked if I don’t fix this?
Future updates to Google Play may block apps that don’t meet the 16KB alignment requirement, so it’s best to fix it now.
Best Practices
To permanently fix this warning and future-proof your app:
✔ Update Android Studio to the latest version
✔ Use AGP 7.2+ and Gradle 7.3+
✔ Upgrade NDK r23b or newer if using native code
✔ Use supported versions of Unity, React Native, Flutter, or Expo
✔ Rebuild your App Bundle (.aab) after upgrading
Once you re-upload the updated bundle, the warning should disappear.
Conclusion
The “Recompile your app with 16KB native library alignment” warning is a helpful signal not an error. It points out that your app’s native libraries are aligned at 4KB instead of the required 16KB for Android 12+.
Whether you're a Unity developer, React Native developer, Flutter developer, or using Expo, updating your build tools and environment will resolve this issue. Aligning libraries correctly not only removes the warning but also improves your app’s performance, security, and future compliance.
Follow the steps outlined in this guide to ensure your app stays up to date and ready for the latest Android requirements.