Requirements
Before building Muun Wallet, ensure you have the following installed:- OpenJDK >= 8
- Golang = 1.24.x
- Android NDK >= 22
- Docker >= 28
Environment Setup
Configure Android NDK
Set theANDROID_NDK_HOME environment variable to point to your NDK installation directory:
Start Docker
Make sure Docker is running before proceeding with the build:Build Steps
Build Rust Libraries
Build the Rust libraries required by libwallet:This script compiles the Rust components for all Android architectures (arm64-v8a, armeabi-v7a, x86, x86_64).
Bootstrap Gomobile
Install and set up the Go mobile toolchain:This installs
gomobile and gobind tools used to build Go code for Android.Build libwallet
Generate the libwallet Android library (AAR):This creates the
libwallet.aar file that contains the Go-based wallet logic compiled for Android.Build Output
After successful compilation, you’ll find the following APK files:apolloui-prod-arm64-v8a-release-unsigned.apk- For 64-bit ARM devicesapolloui-prod-armeabi-v7a-release-unsigned.apk- For 32-bit ARM devicesapolloui-prod-x86-release-unsigned.apk- For 32-bit x86 devicesapolloui-prod-x86_64-release-unsigned.apk- For 64-bit x86 devices
Build Scripts Reference
bootstrap-gomobile.sh
This script prepares the Go mobile build environment:- Creates a shared dependency cache at
libwallet/.build/pkg - Installs
gomobileandgobindtools - Sets up
GOMODCACHEfor dependency management
tools/bootstrap-gomobile.sh
libwallet-android.sh
This script builds the libwallet Android archive:- Configures build cache directories
- Sets 16KB page alignment flags for Android targetSdk 35+ compatibility
- Runs
gomobile bindwith reproducible build flags (-trimpath,-ldflags="-buildid=. -v") - Targets Android API level 19 as minimum
- Binds multiple Go packages:
libwallet,newop,app_provided_data,libwallet_init
tools/libwallet-android.sh
Troubleshooting
Docker Not Running
If you see errors about Docker, ensure the Docker daemon is running:NDK Not Found
Verify yourANDROID_NDK_HOME variable is set correctly:
Gomobile Build Errors
If you encounter issues withsrc-android-* directories, the build script automatically cleans these:
Wrong Go Version
Ensure you’re using Go 1.24.x:Next Steps
- Reproducible Builds - Build using Docker for verification
- APK Verification - Verify your build matches official releases
- Testing - Run the test suite