Skip to content

fix(lib): add 16 KB page size linker flag to Application.mk #1

Description

Problem

Android 15+ devices with 16 KB page sizes cannot load native libraries whose ELF LOAD segments are only 4 KB aligned. Starting November 2025, Google Play requires all apps targeting Android 15+ to support 16 KB page sizes.

Currently all four native libraries produce alignment warnings:

  • libUVCCamera.so
  • libjpeg-turbo1500.so
  • libusb100.so
  • libuvc.so

Solution

Add the following to lib/src/main/jni/Application.mk:

APP_LDFLAGS := -Wl,-z,max-page-size=16384

This forces the linker to align all LOAD segments to 16 KB boundaries, making the libraries compatible with both 4 KB and 16 KB devices.

Verification

After rebuilding, verify with:

readelf -lL libUVCCamera.so | grep LOAD

All LOAD segments should show Align: 0x4000 (16384 bytes).

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions