-
Notifications
You must be signed in to change notification settings - Fork 639
Description
Problem
Google Play now requires all shared libraries (.so files) to be 16KB page-aligned (Android 15+). Apps built with Flet that include native Python dependencies fail this requirement because mobile-forge does not pass the -Wl,-z,max-page-size=16384 linker flag when cross-compiling for Android.
This affects all native .so libraries built by mobile-forge, not just specific packages.
Example from user report (#5607)
A Flet app using reportlab (which depends on Pillow) shows:
✗ libjpeg.so [arm64-v8a] → 4096 (CRITICAL)
✗ libturbojpeg.so [arm64-v8a] → 4096 (CRITICAL)
✗ libjpeg.so [x86_64] → 4096 (CRITICAL)
✗ libturbojpeg.so [x86_64] → 4096 (CRITICAL)
All other libraries (libpython, libfreetype, libcrypto, etc.) that come from python-build-standalone or are linked differently happen to be aligned, but any .so built by mobile-forge recipes without the flag will have 4096-byte alignment.
Solution
Two changes needed in mobile-forge:
-
src/forge/build.py: Add-Wl,-z,max-page-size=16384toLDFLAGSfor Android builds. This automatically covers all autotools-based recipes (./configure && make) which respectLDFLAGS. -
CMake-based recipe
build.shfiles: CMake does not readLDFLAGSfrom the environment, so each CMake recipe that produces shared libraries needs-DCMAKE_SHARED_LINKER_FLAGS="$LDFLAGS"added to its Android cmake invocation. Affected recipes:flet-libjpeg,flet-libcrc32c,flet-libgeos,flet-libproj,flet-libgdal,flet-libpyjni.
Related
- App must support 16 KB memory page sizes #5607 — user report of Google Play rejection due to 16KB alignment
- Android 16KB page size documentation
Metadata
Metadata
Assignees
Labels
Type
Projects
Status