-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Problem
Native libraries built for Android need to be 16KB page-aligned to work correctly on Android 15+ devices. Currently, the Android build workflow does not include the necessary linker flags, which results in this warning during Unity builds:
Plugin 'libfreetype.so' is not 16KB-aligned. This may cause issues on ARM64 devices running Android 15+.
Solution
Add the following CMake flag to the Android build configuration:
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-z,max-page-size=16384"Suggested change for .github/workflows/android.yml:
- name: Configure CMake (${{ matrix.platform.abi }})
run: >
cmake -B build
-DCMAKE_TOOLCHAIN_FILE=$(dirname $(which ndk-build))/build/cmake/android.toolchain.cmake
-DANDROID_ABI=${{ matrix.platform.abi }}
-DBUILD_SHARED_LIBS=1
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=1
-DCMAKE_DISABLE_FIND_PACKAGE_PNG=1
-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=1
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=1
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=1
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-z,max-page-size=16384"References
Metadata
Metadata
Assignees
Labels
No labels