From 91a1928e5ccb92d924bdaa71b0c6b6282a03149f Mon Sep 17 00:00:00 2001 From: Obehi Date: Wed, 4 Mar 2026 10:35:26 +0100 Subject: [PATCH] fix: add 16KB page alignment support for Android Disable precompiled binaries which are built with 4KB page alignment. Google Play requires 16KB alignment for Android 15+ (API 35+). Building from source with NDK r28+ produces correct alignment. Also adds explicit linker flags in .cargo/config.toml as a safety net for builds outside of Cargokit. Closes #181 --- rust/.cargo/config.toml | 16 ++++++++++++++++ rust/cargokit.yaml | 10 +++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 rust/.cargo/config.toml diff --git a/rust/.cargo/config.toml b/rust/.cargo/config.toml new file mode 100644 index 00000000..c2b94876 --- /dev/null +++ b/rust/.cargo/config.toml @@ -0,0 +1,16 @@ +# Ensure 16KB page alignment for Android targets. +# Required by Google Play for Android 15+ (API 35+) compatibility. +# NDK r28+ defaults to this, but explicit flags ensure alignment +# regardless of NDK version or manual build configuration. + +[target.aarch64-linux-android] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"] + +[target.armv7-linux-androideabi] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"] + +[target.i686-linux-android] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"] + +[target.x86_64-linux-android] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"] diff --git a/rust/cargokit.yaml b/rust/cargokit.yaml index 4657395e..5d9f0ff0 100644 --- a/rust/cargokit.yaml +++ b/rust/cargokit.yaml @@ -1,6 +1,10 @@ cargo: release: toolchain: stable -precompiled_binaries: - url_prefix: https://github.com/LtbLightning/bdk-flutter/releases/download/precompiled_ - public_key: 0e43d5e8452d00db7f3000c18fb1ba796babfcb5dc6306bb0629eff24f8be85b \ No newline at end of file +# Disabled: precompiled binaries are built with 4KB page alignment (0x1000). +# Google Play now requires 16KB alignment (0x4000) for native libraries. +# Building from source with NDK r28+ produces correct 16KB alignment. +# Re-enable once precompiled binaries are rebuilt with 16KB page alignment. +# precompiled_binaries: +# url_prefix: https://github.com/LtbLightning/bdk-flutter/releases/download/precompiled_ +# public_key: 0e43d5e8452d00db7f3000c18fb1ba796babfcb5dc6306bb0629eff24f8be85b \ No newline at end of file