Skip to content

fix: 16KB page alignment for Android 15+ devices#28

Open
williamomeara wants to merge 1 commit intoEPNW:masterfrom
williamomeara:fix/android-16kb-page-alignment
Open

fix: 16KB page alignment for Android 15+ devices#28
williamomeara wants to merge 1 commit intoEPNW:masterfrom
williamomeara:fix/android-16kb-page-alignment

Conversation

@williamomeara
Copy link

Summary

  • Adds LOCAL_LDFLAGS += -Wl,-z,max-page-size=16384 to opus_flutter_android/android/Android.mk to align ELF LOAD segments to 16KB
  • Fixes compatibility with Android 15+ devices that use 16KB memory page sizes (e.g. Pixel 9)
  • Resolves Google Play Console warnings/rejections for APKs containing 4KB-aligned native libraries

Details

Android 15 introduced support for 16KB memory page sizes. The NDK's default max-page-size of 4KB causes native libraries to fail loading on these devices. Setting max-page-size=16384 ensures the linker produces binaries compatible with both 4KB and 16KB page size devices — no functional change to the library.

Reference: Android developer docs on 16KB page sizes

Test plan

  • Verify Android.mk parses correctly (single additive line, no syntax change)
  • Build an APK and confirm with readelf -l that LOAD segments show 0x4000 alignment

🤖 Generated with Claude Code

Android 15 introduces support for 16KB memory page sizes. Native
libraries built with the default 4KB max-page-size fail to load on
these devices and are rejected by Google Play Console.

Adding -Wl,-z,max-page-size=16384 to LOCAL_LDFLAGS ensures the linker
aligns LOAD segments to 16KB, which is backward-compatible with 4KB
devices.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant