Repository navigation
fix(android): make play() start the configured state machine on cold start - #343
Merged
Merged
Conversation
mfazekas
force-pushed
the
fix/android-play-cold-start-state-machine
branch
5 times, most recently
from
July 16, 2026 10:48
a058360 to
5de09ba
Compare
HayesGordon
approved these changes
Jul 16, 2026
HayesGordon
left a comment
Contributor
There was a problem hiding this comment.
So annoying that the old Rive Android API is like this
Excited to get all of this out. Thanks for the fix!
…d state machine Fails on Android: the legacy wrapper's play() falls through to rive-android's no-arg controller.play() (first raw animation + first state machine, not the configured one) and never records the active state machine name, so input writes afterwards throw "View not configured". Matches the reporter's follow-up on issue #332. Control case (autoPlay=true) passes.
…start With autoPlay=false nothing is instanced yet, and rive-android's no-arg controller.play() starts the artboard's first raw animation plus its first state machine, ignoring the configured stateMachineName — wrong content renders and the wrapper never records the active state machine, so input writes throw "View not configured" (issue #332 follow-up). Start the configured state machine explicitly on cold start (falling back to the artboard's first, matching autoplay), and keep the no-arg resume path for paused instances and animation-only files.
mfazekas
force-pushed
the
fix/android-play-cold-start-state-machine
branch
from
July 16, 2026 21:26
5de09ba to
2ec489b
Compare
mfazekas
enabled auto-merge (squash)
July 16, 2026 21:26
mfazekas
pushed a commit
that referenced
this pull request
Jul 17, 2026
🤖 I have created a release *beep* *boop* --- ## [0.4.19](v0.4.18...v0.4.19) (2026-07-16) ### Bug Fixes * **android:** make play() start the configured state machine on cold start ([#343](#343)) ([99344d8](99344d8)), closes [#332](#332) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
mfazekas
added a commit
that referenced
this pull request
Jul 20, 2026
play-after-autoplay-false came from main (#343, a legacy fix) and drives the state machine via SMI inputs, which the experimental backends reject by design.
mfazekas
pushed a commit
to Nodonisko/rive-nitro-react-native
that referenced
this pull request
Oct 6, 2026
The deferAutoPlay branch in configure() used the no-arg play(), which on a cold start also starts the artboard's first raw timeline animation. That timeline then draws over the data-bound state machine, showing the wrong state. Same bug class as rive-app#332, already fixed for the public play() in rive-app#343 - this applies the same explicit start to the internal call site. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Android, calling
play()on a view mounted withautoPlay={false}didn't start the configured state machine: nothing is instanced at that point, so the wrapper fell through to rive-android's no-argcontroller.play(), which starts the artboard's first raw animation plus its first state machine (ignoringstateMachineName). The result was wrong content (two timelines fighting) and, because the wrapper sampled the active state machine name before anything existed, subsequent input writes threw "View not configured. Could not find active state machine name". Reported in the follow-up of #332 ("play/playIfNeeded didn't work"); iOS was unaffected.play()now starts the configured state machine explicitly on cold start (falling back to the artboard's first, matching whatautoplaydoes) and records it as active. The no-arg resume path is kept forpause()/play()cycles and for animation-only files.Includes a harness test that fails without the fix ("View not configured") and passes with it; verified on the Android emulator harness (full suite green) and on iOS (passes before and after).
Refs #332