Skip to content

Commit 29dbbc0

Browse files
runanywhere_genie: tolerate missing private binary at build time
The Genie engine is a closed-source private backend. When its release asset isn't reachable (no network, release not yet published, auth-gated distribution), the Flutter plugin's downloadNativeLibs gradle task was hard-failing the build via ant.get throwing. Wrap the download in try/catch so the plugin always builds. Runtime absence is already handled: GeniePlugin.kt wraps System.loadLibrary in try/catch and logs a warning; Dart bindings resolve rac_backend_genie_register via the commons FFI and skip registration when symbols aren't present. Public repo now compiles cleanly without the Genie binary; consumers who install the engine (either via testLocal=true local .so files or via the published GitHub release) pick up NPU inference automatically.
1 parent aa34aa1 commit 29dbbc0

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

  • sdk/runanywhere-flutter/packages/runanywhere_genie/android

sdk/runanywhere-flutter/packages/runanywhere_genie/android/build.gradle

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,21 @@ task downloadNativeLibs {
103103

104104
println "Downloading from: ${downloadUrl}"
105105

106-
// Download the zip file
107-
ant.get(src: downloadUrl, dest: zipFile)
108-
109-
println "✅ Downloaded successfully"
106+
// The Genie engine is a closed-source private backend. If the
107+
// release asset isn't reachable (no network, release not yet
108+
// published, auth-gated distribution), we must NOT fail the build —
109+
// the Flutter plugin's GeniePlugin.kt wraps System.loadLibrary in
110+
// try/catch, so absence is handled gracefully at runtime. Public
111+
// builds that don't need Genie can proceed with empty jniLibs.
112+
try {
113+
ant.get(src: downloadUrl, dest: zipFile)
114+
println "✅ Downloaded successfully"
115+
} catch (Exception e) {
116+
println "⚠️ Could not download RABackendGenie native libraries: ${e.message}"
117+
println "⚠️ Continuing without Genie binaries — loadLibrary will fail gracefully at runtime."
118+
println "⚠️ To build with the engine, either host the release at ${downloadUrl} or set testLocal=true with local .so files."
119+
return
120+
}
110121

111122
// Extract to temp directory first
112123
def tempDir = file("${buildDir}/genie-temp")

0 commit comments

Comments
 (0)