plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("com.chaquo.python") } android { namespace = "com.ledgrab.android" compileSdk = 34 defaultConfig { applicationId = "com.ledgrab.android" minSdk = 24 // Android 7.0 — covers nearly all TV boxes targetSdk = 34 versionCode = 1 versionName = "0.3.0" ndk { // Temporarily x86 only for emulator testing with new wheel abiFilters += listOf("x86") } } buildTypes { release { isMinifyEnabled = false } } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = "17" } } chaquopy { defaultConfig { version = "3.11" pip { // Pre-built wheels directory (for pydantic-core etc.) // Must use absolute file:// URI with forward slashes options("--find-links", "file:///${rootDir.absolutePath.replace("\\", "/")}/wheels/") // ── Android-compatible dependencies ───────────────── // Listed explicitly because pyproject.toml includes // desktop-only packages with no Android wheels. // See CLAUDE.md "Android Dependency Sync" for policy. install("fastapi") install("uvicorn") // without [standard] — no uvloop/httptools install("httpx") install("numpy") install("pydantic") // needs pydantic-core wheel in wheels/ install("pydantic-settings") install("PyYAML") install("structlog") install("python-json-logger") install("python-dateutil") install("python-multipart") install("jinja2") install("zeroconf") install("aiomqtt") install("openrgb-python") // opencv-python-headless: no cp311 Android wheel on Chaquopy. // LedGrab's cv2 usage is guarded with try/except ImportError // and falls back to numpy/Pillow alternatives on Android. install("Pillow") install("websockets") } } } // LedGrab Python source is included via a directory junction: // android/app/src/main/python/ledgrab -> server/src/ledgrab // This is the standard Chaquopy way to include local Python packages. // Create the junction (run from repo root, no admin needed): // cmd /c "mklink /J android\app\src\main\python\ledgrab server\src\ledgrab" dependencies { implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.appcompat:appcompat:1.7.0") implementation("androidx.leanback:leanback:1.0.0") implementation("com.google.android.material:material:1.12.0") implementation("androidx.lifecycle:lifecycle-service:2.8.7") // QR code generation for displaying server URL on TV implementation("com.google.zxing:core:3.5.3") }