The Story Circuit Header LogoThe Story Circuit
Google Play Console warning about 16KB native library alignment
Fixing 16KB native library alignment warning in Play Console

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 often confuses developers, but the fix is straightforward once you understand what it means. 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 16KB alignment for native libraries (.so files).

This improves:

    • Performance → Faster loading of libraries
    • Security → Consistent memory alignment
    • Future compliance → Google Play may block non-aligned apps in future updates

If your app is built with older Android Gradle Plugin (AGP), NDK, or Unity versions, the .so libraries might still be aligned to 4KB, triggering this warning.


How to Fix the Warning

1. Update Android Gradle Plugin (AGP) & Gradle

If you’re using Android Studio, 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
    • Check your build.gradle:

android {

   defaultConfig {

       ndk {

           abiFilters "armeabi-v7a", "arm64-v8a"

       }

   }

}


3. Unity Developers

If you’re building with Unity:

    • Upgrade to Unity 2021.3 LTS or newer (these versions already use 16KB alignment)
    • For older Unity versions, rebuild using the latest Gradle export instead of directly exporting APKs

4. Manual Workaround with zipalign (Not Recommended Long-Term)

If you cannot upgrade tools immediately, you can try using zipalign.

Example:

zipalign -p -f -v 4096 app-release.aab app-fixed.aab

⚠️ Note: Standard zipalign aligns at 4KB, not 16KB. For proper 16KB alignment, upgrading AGP/NDK is the only reliable fix.


🚀 Best Practice

The most reliable way to fix this warning is to:

    • Update Android Studio to the latest version
    • Use AGP 7.2+ and Gradle 7.3+
    • Rebuild your App Bundle (.aab)

Once you re-upload, the warning in Play Console should disappear.


📝 Conclusion

The “Recompile your app with 16KB native library alignment” warning is not an error, but it’s a signal that your app is using outdated build tools. Updating your Gradle, AGP, or Unity/NDK versions will permanently fix the issue and keep your app future-proof.

By ensuring proper 16KB alignment, you’ll not only clear the Play Console warning but also optimize your app’s performance and compliance for upcoming Android versions.