Skip to content

fix(android): fall back with a warning when GPU Canvas is unavailable - #383

Merged
mfazekas merged 1 commit into
claude/gpu-canvas-beta-android-ios-7ccb40from
claude/gpu-canvas-deferred-reflection
Sep 22, 2026
Merged

mfazekas merged 1 commit into
claude/gpu-canvas-beta-android-ios-7ccb40from
claude/gpu-canvas-deferred-reflection

Conversation

@mfazekas

Copy link
Copy Markdown
Collaborator

Stacked on #381. The GPU Canvas worker on Android was reached through a Java shim that named rive-android's Kotlin-internal createDeferred$kotlin_release at compile time, so any rive-android without that exact symbol (an older Rive_RiveRuntimeAndroidVersion override, or an upstream rename) failed the build.

DeferredRiveWorker now looks the method up by reflection, accepting the mangled name or a plain createDeferred (so it keeps working if upstream makes it public). When it is missing, the shared worker is created without GPU Canvas, a warning goes through RiveLog, and RiveRuntime.isGPUCanvasEnabled() reports false from then on. A real worker-init failure still throws.

Verified on the Pixel 6 emulator with the ore.riv demo: on 11.12.1 the 3D scene renders as before; on 11.11.0 (no deferred worker, previously a compile error) the app builds, logs the warning and runs without GPU Canvas.

…th a warning

CommandQueue.createDeferred is Kotlin-internal, so the GPU Canvas worker was
reached through a Java shim that named the mangled method at compile time.
A rive-android without that exact symbol (older override, or an upstream
rename) broke the build. Look it up reflectively instead, accepting either
the mangled or a plain createDeferred; when it is missing the worker is
created without GPU Canvas, RiveLog warns, and isGPUCanvasEnabled() turns
false.
@mfazekas
mfazekas added this pull request to stack #384 September 22, 2026 08:23
@mfazekas

Copy link
Copy Markdown
Collaborator Author

Folded into #381 (its branch now includes this commit) so the feature is reviewed once with the fallback in place.

@mfazekas mfazekas closed this Sep 22, 2026
@mfazekas
mfazekas deleted the claude/gpu-canvas-deferred-reflection branch September 22, 2026 15:54
@mfazekas
mfazekas merged commit e2d17f4 into main Sep 22, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant