#!/bin/bash # PAILot Android AAB Build Script # Produces a Play Store-ready signed App Bundle. set -e SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" APP_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" cd "$APP_DIR" # Pin JDK 21 — system openjdk 25 is not yet parseable by the Kotlin compiler # bundled with AGP. JDK 17 also works if you prefer; just point JAVA_HOME at it. JDK="${JAVA_HOME_RELEASE:-/opt/homebrew/Cellar/openjdk@21/21.0.11/libexec/openjdk.jdk/Contents/Home}" echo "=== Building Android App Bundle (AAB) ===" JAVA_HOME="$JDK" flutter build appbundle --release --no-tree-shake-icons echo "" echo "=== Done ===" AAB=build/app/outputs/bundle/release/app-release.aab ls -la "$AAB" echo "" echo "Upload $AAB to the Play Console (Production → Create new release)."