Skip to content

Building from Source

Puzzak edited this page Nov 20, 2026 · 1 revision

Building from Source

PAIOS targets Android 14+ (minSdk = 34, targetSdk = 36) using Flutter (Dart ^3.9.2), Kotlin (JVM 11), and the modular m3x packages (m3x, m3x_ui, m3x_dict, m3x_core, m3x_chat, m3x_mesh).


Prerequisites

  • Flutter SDK (supporting Dart ^3.9.2)
  • Android SDK (compileSdk / targetSdk 36, minSdk 34) & JDK 11+
  • Git (plus sibling demo repository if building with local path dependencies configured in pubspec.yaml)
  • Physical Android Device on the Supported Devices list with Google AICore installed and a locked bootloader for live on-device inference testing (emulators do not run AICore NPU models).

Setup & Dependencies

git clone https://github.com/Puzzaks/PAIOS.git
cd PAIOS
flutter pub get

Running Unit & Widget Tests

Flutter / Dart Test Suite

Run all Dart unit and widget tests sequentially (-j 1 prevents concurrent Hive/temp file contention):

flutter test -j 1

Covers engine hardening (hardening_184_test.dart), translator parity & mojibake immunity (bugfix_v3_translator_test.dart, translation_parity_and_refs_test.dart), storage migration (storage_and_migration_test.dart), viewport layout (viewport_scroll_test.dart), docs/tools (doc_service_test.dart, internal_tools_service_test.dart), onboarding (intro_test.dart), and M3x Mesh (mesh_test.dart).

Android Kotlin JVM Unit Tests

Run native Kotlin unit tests (covering PaiosModelHelperTest.kt and InternalToolsHelperTest.kt):

cd android
.\gradlew.bat :app:testDebugUnitTest

(On Linux/macOS, use ./gradlew :app:testDebugUnitTest.)


Building APKs & Release Signing Fallback

flutter build apk --release

Automatic Debug-Signing Fallback (key.properties Absent)

In android/app/build.gradle.kts, signingConfigs.release is guarded by hasReleaseKeystore (which checks for android/key.properties and its keystore fields):

  • With key.properties: Signs release and debug builds with your configured release keystore.
  • Without key.properties (e.g., contributor local builds and CI PR checks): Cleanly falls back to signingConfigs.getByName("debug") so flutter build apk --release and flutter run --release succeed out of the box without manual Gradle edits.

Contributing Guidelines

  • Please check CONTRIBUTING.md and SECURITY.md before opening a PR.
  • When reporting device/AICore bugs on GitHub Issues, include your device model, Android OS version, AICore version, and any surfaced GenAiException.ErrorCode (-101, 9, 601, 606, etc.).

Related Pages: Architecture & Model Variants · Supported Devices & AICore Error Taxonomy · Roadmap & Changelog

Clone this wiki locally