-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
π§ Native Library Alignment Issue with ML Kit Libraries for 16 KB Page Size Compatibility (Google Play Requirement)
π§© Affected Libraries
gradle
implementation("com.google.mlkit:vision-common:17.3.0")
implementation("com.google.mlkit:text-recognition:16.0.1")
π± Affected Architectures
arm64-v8a
x86_64
β Issue Description
When building an APK or AAB that includes the above ML Kit dependencies and targeting Android 15 (API level 35), the build outputs trigger this error during Play Store validation or when running
APK SampleApp-debug.apk is not compatible with 16 KB devices.
Some libraries have LOAD segments not aligned at 16 KB boundaries:
lib/arm64-v8a/libimage_processing_util_jni.so
Starting November 1st, 2025, Google Play will reject new apps or updates that do not comply with the 16 KB page size requirement:
https://developer.android.com/16kb-page-size
π§ͺ How to Reproduce
Create a new Android project.
Add the ML Kit dependencies listed above.
Set compileSdk and targetSdk to 35.
Use AGP 8.5+ and Gradle 8.3+.
Build an APK or AAB with stripDebugSymbols enabled.
Observe alignment warning or Play Console rejection.
β Expected Behavior
ML Kit native libraries (e.g., libimage_processing_util_jni.so) should have their LOAD segments aligned at 16 KB (0x4000) boundaries, per Play policy.
π§ Actual Behavior
The affected .so files appear to have default alignment (e.g., 4 KB), which results in compatibility issues with devices using a 16 KB page size.
π οΈ Temporary Workarounds (But Not Long-Term Solutions)
Filtering only 64-bit ABIs (e.g., arm64-v8a, x86_64)
Manually extracting .so files, aligning via zipalign, and repackaging the AAR
Delaying support for Android 15+
Disabling symbol stripping (not Play-compliant)
π Request
Please release updated versions of ML Kit libraries with:
Native .so libraries aligned to 16 KB boundaries prior to the November 1, 2025 Google Play policy enforcement