Skip to content

🐛 Bug Report: libucs-credential.so and libTransform.so not 16KB Page Aligned on Android #425

@lmdanishirfan

Description

@lmdanishirfan

Problem Statement

Our Flutter application, which uses the huawei_location plugin, is encountering issues on Android devices with 16KB memory page sizes (especially Android 14/15+ with the Impeller rendering engine enabled). Specifically, the native libraries libucs-credential.so and libTransform.so, bundled within the huawei_location package, are detected as being 4KB page size aligned instead of the required 16KB.

This misalignment can lead to:

App crashes or failures to load the location services on affected devices.

Warnings in the Google Play Console indicating non-compliance with Android 15+ compatibility requirements.

Potential rejection from Google Play for new app submissions or updates targeting Android 15+.

Expected Behavior

The native libraries (libucs-credential.so and libTransform.so) included in the huawei_location Flutter package should be compiled with 16KB ELF segment alignment to ensure full compatibility with modern Android devices and operating system versions (Android 15+).

Steps to Reproduce
Integrate the huawei_location package into a Flutter project.

Build the Flutter application for Android (e.g., flutter build apk --release or flutter build appbundle --release).

Extract the generated APK/AAB file.

Use llvm-objdump (from Android NDK) to inspect the alignment of the shared libraries. For example, on a Linux/macOS terminal:

unzip your_app.apk -d /tmp/my_apk_out
find /tmp/my_apk_out/lib -name "*.so" -exec sh -c 'echo "\n{}"; llvm-objdump -p "{}" | grep "LOAD"' ;

Observe the output for libucs-credential.so and libTransform.so.

Actual Result: The align value for the LOAD segments of libucs-credential.so and libTransform.so shows 212 (4096 bytes) instead of 214 (16384 bytes).

Environment

Flutter Version: 3.24.5

huawei_location Package Version: (latest)

Android Gradle Plugin (AGP) Version: 8.6

Android NDK Version: 28

Target Android API Level (from build.gradle): 35

Device/Emulator where issue is reproduced: (e.g., Pixel 8 Pro with Android 15 Beta, 16KB page size enabled)

Proposed Solution

We request an update to the huawei_location Flutter package. This update should ensure that all included native libraries, especially libucs-credential.so and libTransform.so, are compiled with 16KB ELF segment alignment. This is crucial for app compatibility and performance on newer Android devices and to meet Google Play submission requirements.

Metadata

Metadata

Assignees

No one assigned

    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