googlesamples / googlesamples/mlkit
ML Kit Face Detection (16.1.7) not compatible with 16KB page size causing native library load failure on Android 14+
- Dominant language
- Kotlin
- Stars
- 4.3k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
The ML Kit Face Detection library (com.google.mlkit:face-detection:16.1.7) is not aligned with the 16KB page size requirement introduced in newer Android versions. This causes compatibility issues and potential crashes or warnings on devices that enforce 16KB memory page alignment (e.g., Android 14+ devices with updated kernel requirements).
The native binaries bundled with the library appear to still be built with 4KB page size alignment, making them incompatible with newer system constraints.
**To Reproduce**
Integrate ML Kit Face Detection library in Android project:
implementation "com.google.mlkit:face-detection:16.1.7"
Build and run the app on a device/emulator supporting 16KB page size (Android 14+ or specific hardware).
Trigger face detection using camera or image input.
Observe runtime warnings / crashes related to page size alignment (e.g., linker errors or native library load failure).
If applicable, please include `code snippet` and `sample input(image, video, text, etc)`
FaceDetectorOptions options =
new FaceDetectorOptions.Builder()
.setPerformanceMode(FaceDetectorOptions.PERFORMANCE_MODE_FAST)
.build();
FaceDetector detector = FaceDetection.getClient(options);
InputImage image = InputImage.fromBitmap(bitmap, 0);
detector.process(image)
.addOnSuccessListener(faces -> {
// Handle detected faces
})
.addOnFailureListener(e -> {
e.printStackTrace();
});
**Expected behavior**
The ML Kit Face Detection library should support 16KB page size alignment and work seamlessly on newer Android devices without crashes, warnings, or native library loading issues.
**SDK Info:**
- SDK Name & Version [com.google.mlkit:face-detection:16.1.7]
**Smartphone:**
Device/Simulator: Pixel 8 / Pixel 9 PRO (or any 16KB page size supported device)
Device/Simulator OS: Android 15
**Development Environment:**
IDE Version: Android Studio Hedgehog / Iguana
Laptop/Desktop: MacBook Pro (Intel / M1)
Laptop/Desktop OS/version: macOS Sonoma / Ventura
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.