Skip to content

ML Kit native libraries not 16KB aligned – fails stripReleaseDebugSymbols in AGP 8.5+ #947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
adarsh-dhakad opened this issue May 27, 2025 · 0 comments
Assignees

Comments

@adarsh-dhakad
Copy link

adarsh-dhakad commented May 27, 2025

When using com.google.mlkit:barcode-scanning:17.3.0, the release build fails alignment verification on Android Gradle Plugin (AGP) 8.5.1 due to native .so libraries not being aligned to 16KB as required. This leads to the following warning in the build log:

    Task :app:stripReleaseDebugSymbols
    Unable to strip the following libraries, packaging them as they are:
    libbarhopper_v3.so, libimage_processing_util_jni.so, libsurface_util_jni.so

This violates ELF alignment requirements introduced in AGP 8.5+, affecting reproducible and compliant builds.

To Reproduce
Steps to reproduce the behavior in a sample Android app:

Add ML Kit dependency:
implementation 'com.google.mlkit:barcode-scanning:17.3.0'

Build a release APK using AGP 8.5.1
Observe build logs or run alignment verification with check_elf_alignment.sh
See ELF alignment errors on .so files

Expected behavior
The native .so libraries (libbarhopper_v3.so, libimage_processing_util_jni.so, libsurface_util_jni.so) should be aligned to 16KB (2¹⁴) so that AGP 8.5+ builds can strip symbols and package them correctly without warnings or errors.

SDK Info:
-SDK Name & Version: com.google.mlkit:barcode-scanning:17.3.0

Smartphone:
Device/Simulator: Pixel 6, emulator also affected
Device/Simulator OS: Android 14 (API 34), also tested on Android 13

Development Environment:
IDE Version: Android Studio Meerkat | 2024.3.1
Laptop/Desktop: MacBook Pro (M2, 2022)
Laptop/Desktop OS: macOS 14.4 Sonoma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants