Release / Build and Release APK (push) Failing after 9m2s
Root cause: ML Kit Gemini Nano enforces ErrorCode 30 (foreground restriction) at the AICore binder level. No foreground service or wake lock can bypass it — the app's Activity must be the visible top window. Fix: MediaPipe LLM Inference runs entirely in the app process via the Tensor G5 GPU (OpenCL/Vulkan), with no AICore dependency and no foreground restriction. Changes: - OnDeviceModel.create() now tries MediaPipe FIRST, Nano second - ModelDownloader.kt: downloads Gemma 2B IT GPU INT4 (~1.3GB) from Google's MediaPipe model CDN with resume support (Range header) - MainActivity: "Download Model" card shows download status and progress bar; auto-hides once model is present; uses lifecycleScope for coroutine - Layout: model card inserted between status and port field - Strings: btn_download_model, model_downloaded, model_not_downloaded Once the model is downloaded the server accepts requests in the background indefinitely with no foreground Activity required. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>