Skip to content

Building and Signing

CaptainDario edited this page Mar 26, 2025 · 12 revisions

Windows

To build a .exe

flutter build windows --release

To build a MSIX

flutter pub run msix:create 

To build a MSIX (for publishing to the Microsoft Store) without rebuilding the .exe

flutter pub run msix:create --build-windows=false --store

To build a MSIX (for publishing on GitHub self-signed) without rebuilding the .exe (for this the certificate and the password are required)

flutter pub run msix:create --build-windows=false -c ./keys/dakanji_self_sign_msix.pfx -p THE_PASSWORD

Build can be found at: DaKanji-Application\build\windows\runner\

Android

To build the app as an app bundle just invoke

flutter build appbundle

To obfuscate, save the symbol files and build the app.

flutter build appbundle --obfuscate --split-debug-info=obfuscate_debug_info

To build a fat apk:

flutter build apk --obfuscate --split-debug-info=obfuscate_debug_info

and platform dependent, smaller apk's:

flutter build apk --obfuscate --split-debug-info=obfuscate_debug_info --split-per-abi

Build can be found at: DaKanji-Application\build\app\outputs

Signing for Android

The key.properties file should be placed in the android folder.

And the DaKanjiRecognizer.jks file should be placed in the keys folder

Linux

Arm 64

  1. Install Flutter
# get flutter dependencies
sudo apt-get update -y && sudo apt-get upgrade -y;
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev

# get flutter (no binaries provided, download from source)
git clone https://github.com/flutter/flutter

# get dakanji dependencies
sudo apt install libmpv-dev mpv
  1. Add flutter to your path

  2. Install rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Arm64 problems

GL problems

gdk_gl_context_make_current: assertion 'GDK_IS_GL_CONTEXT (context)' failed

I encountered this problem in an ARM64 VM. It could be fixed by defaulting to software rendering, like this:

export LIBGL_ALWAYS_SOFTWARE=1

Snap

A snapcraft.yaml is provided in

snap/snapcraft.yaml

A snap can be built by

snapcraft --use-lxd

Clean snapcraft built

snapcraft clean --use-lxd

Un-/Install snap for testing

sudo snap install dakanji_xxx.snap --devmode
sudo snap remove dakanji

Flatpak

Either run the build script

cd flatpak
python3 build_flatpak.py

or the individual commands

flatpak-builder build-dir  com.DaAppLab.DaKanji.yml
flatpak-builder --repo=repo --force-clean build-dir com.DaAppLab.DaKanji.yml
flatpak build-bundle repo com.DaAppLab.DaKanji.flatpak com.DaAppLab.DaKanji

Clone this wiki locally