Minimal wrapper project for building the Flutter engine, Android embedding artifacts, and a Termux-ready Android-bionic host toolchain bundle with the Android NDK.
This repo does not vendor the full Flutter engine checkout. build.sh bootstraps depot_tools, fetches the Flutter engine source on first run, applies the local compatibility patches, and then builds either the requested Android ABI or the Termux host bundle overlay.
libflutter.soflutter.jar- ABI-specific Android jar such as
arm64_v8a_debug.jar - a Termux host bundle tarball that overlays Flutter's
bin/cachewith:- Android-bionic
dart-sdk font-subsetconst_finder.dart.snapshotgen_snapshotfor:android-arm-profile/android-arm64android-arm-release/android-arm64android-arm64-profile/android-arm64android-arm64-release/android-arm64android-x64-profile/android-arm64android-x64-release/android-arm64
- Android-bionic
- standalone mirror zips in
dist/:android-arm-profile-android-arm64.zipandroid-arm-release-android-arm64.zipandroid-arm64-profile-android-arm64.zipandroid-arm64-release-android-arm64.zipandroid-x64-profile-android-arm64.zipandroid-x64-release-android-arm64.zipdart-sdk-android-arm64.zipdart-sdk-android-arm64-<engine-stamp>.zipflutter_patched_sdk-<engine-stamp>.zipflutter_patched_sdk_product-<engine-stamp>.ziplinux-arm64-tools-<engine-stamp>.zip
The Termux host bundle rewrites the Dart SDK version from prerelease syntax to
stable build-metadata syntax (for example 3.7.0-260.0.dev becomes
3.7.0+260.0.dev) so Flutter's pub dependency resolution accepts it.
The current patch set is tuned for Android NDK r27c and keeps libflutter.so linked only against Android system libraries for broad compatibility.
arm64-v8aarmeabi-v7ax86x86_64
gitpython3- Android NDK (
ANDROID_NDK_HOMEis preferred)
The script auto-detects these NDK locations:
$ANDROID_NDK_HOME/root/codex-termux/.build-tools/android/android-ndk-r27c- Flutter's vendored NDK inside the fetched checkout
/data/data/com.termux/files/home/.build-tools/android/android-ndk-r27c
If curl or wget is unavailable, the script falls back to python3 for downloads.
Build one ABI:
./build.sh debug arm64-v8a yBuild all Android ABIs:
./build.sh debug all yBuild the Termux host bundle overlay:
./build.sh termux-sdkArgument format:
./build.sh <debug|profile|release> <arm64-v8a|armeabi-v7a|x86|x86_64|all> <y|n>The last flag controls whether Vulkan validation layers are disabled in debug builds for better portability.
The Termux host bundle command currently builds the arm64 host overlay only and writes a tarball into dist/.
Set FLUTTER_TERMUX_ENGINE_STAMP to override the engine-stamp suffix used for
mirror zip names (default is Flutter 3.32.8 engine stamp:
ef0cd000916d64fa0c5d09cc809fa7ad244a5767).
Stored patches live in patches/ and are applied automatically to the matching engine checkout (src/ or src/flutter/) when needed.
- GitHub:
@sirvkrm - Telegram:
@sirvkrm(https://t.me/sirvkrm)