In 2024, Android announced support for 16 KB page sizes, starting with Android 15. In recent months, the Google Play Store has started to check for 16 KB compatibility in the app review process. If your APK is not compatible, you might get a review issue.
Am I impacted?
If you get errors like the above in your submission, then you are impacted. To check this before a submission, you can follow the steps below:
1) Do you use NDK?
The 16 KB requirements generally do not impact the Java or Kotlin code. It does, however, if you use Native (C/C++) code, via the NDK. This includes direct or indirect use of native code (from the libraries you added to your apps). If you do not use any NDK, then your app is automatically compatible.
2) How do I know if my app uses any NDK?
For a quick check, you can use the Analyze APK tool in Android Studio.
Look for the "lib" directory. If you use native code, you can observe ".so" files here.
How to comply?
1) If you use Native code directly, you need to upgrade your NDK to r28 and rebuild your application. Refer here for more details.
2) If you use Native code indirectly from other libraries, refer to the individual guide to upgrade the libraries to a compatible version.
How do I verify my fixes?
There are several options.
1) Build and test your application in a 16 KB enabled emulator.
2) On a Pixel phone, enable the 16 KB option in developer mode.
3) Download this script provided by Google to check your native libraries' alignment.
chmod +x ./check_elf_alignment.sh
./check_elf_alignment.sh my.apk
You should get a list of native libraries and whether or not they are 16 KB aligned.
Recursively analyzing ./my.apk
NOTICE: Zip alignment check requires build-tools version 35.0.0-rc3 or higher.
You can install the latest build-tools by running the below command
and updating your $PATH:
sdkmanager "build-tools;35.0.0-rc3"
=== ELF alignment ===
...
...
...
\e[31mFound 11 unaligned libs (only arm64-v8a/x86_64 libs need to be aligned).\e[0m