Skip to content

[Bug report] ML Kit Libraries for 16 KB Page Size CompatibilityΒ #975

@HarminderSinghSandhu

Description

@HarminderSinghSandhu

πŸ”§ 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions