Before building the app, make sure you have all the necessary tools installed. Follow the instructions in the Environment Setup document. Alternatively, you can use the Docker image as described here: (TODO!).
Optionally, you can enable Firebase Analytics for the app. To do so, follow the instructions in the Firebase Analytics Setup document.
--enforce-lockfile and --no-pub flags when building for production.
flutter pub get --enforce-lockfile
flutter build web --csp --no-web-resources-cdn --no-pubflutter pub get --enforce-lockfile
flutter build web --csp --no-web-resources-cdn --no-pub --wasmThe release version of the app will be located in build/web folder. Specifying the --release flag is not necessary, as it is the default behavior.
WebAssembly builds require COEP/COOP headers on the hosting layer (see WebAssembly hosting headers).
Run flutter build {TARGET} command with one of the following targets:
apk- builds Android APK (output tobuild/app/outputs/flutter-apkfolder)appbundle- builds Android bundle (output tobuild/app/outputs/bundle/releasefolder)ios- builds for iOS (output tobuild/ios/iphoneosfolder)macos- builds for macOS (output tobuild/macos/Build/Products/Releasefolder)linux- builds for Linux (output tobuild/linux/x64/release/bundlefolder)windows- builds for Windows (output tobuild/windows/runner/Releasefolder)
Example:
flutter build apkPrerequisite (ensure SDK submodule is initialized to the pinned commit):
git submodule update --init --recursive
# Recommended once per clone to auto-fetch pinned commits on branch switches
git config fetch.recurseSubmodules on-demandsh .docker/build.sh web releaseAlternatively, you can run the docker build commands directly:
# Build the supporting images
docker build -f .docker/kdf-android.dockerfile . -t komodo/kdf-android --build-arg KDF_BRANCH=main
docker build -f .docker/android-sdk.dockerfile . -t komodo/android-sdk:34
docker build -f .docker/gleec-wallet-android.dockerfile . -t gleec/gleec-wallet
# Build the app
mkdir -p build
docker run --rm -v ./build:/app/build gleec/gleec-wallet:latest bash -c "flutter pub get --enforce-lockfile && flutter build web --no-pub --release --wasm"sh .docker/build.sh android releaseAlternatively, you can run the docker build commands directly:
# Build the supporting images
docker build -f .docker/kdf-android.dockerfile . -t komodo/kdf-android --build-arg KDF_BRANCH=main
docker build -f .docker/android-sdk.dockerfile . -t komodo/android-sdk:34
docker build -f .docker/gleec-wallet-android.dockerfile . -t gleec/gleec-wallet
# Build the app
mkdir -p build
docker run --rm -v ./build:/app/build gleec/gleec-wallet:latest bash -c "flutter pub get --enforce-lockfile && flutter build apk --no-pub --release"For Flutter web --wasm builds with multi-threading, set these response headers:
Cross-Origin-Embedder-Policy: credentialless(orrequire-corp)Cross-Origin-Opener-Policy: same-origin
Project defaults already include these headers in:
firebase.json(Firebase Hosting)roles/nginx/templates/airdex.conf.j2(nginx deployment template)