Crash on iPhone 11 when playing multiple RiveViewModel instances — first launch / after detach from Xcode
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 822
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Description
Description
The app crashes on a physical iPhone 11 when using two concurrent RiveViewModel instances (background + icon) and interacting with play/visibility. The crash is easier to reproduce on the first install run, and when the app is run without the Xcode debugger attached.
Environment
- Device: iPhone 11 (physical device, iOS 16.4)
- Rive:
RiveRuntime6.17.0 (CocoaPods) - Minimum iOS: 15.0
- Integration:
@_spi(RiveExperimental) import RiveRuntime - Xcode: Xcode 16.2 (16C5032a)
Steps to reproduce
- Build and install the minimal demo on iPhone 11 (see reproduction project below).
- Launch the app.
- Tap Play Both (starts playback on small button; large button only if visible).
- Tap Toggle Large Visible repeatedly.
- Optional but reported as more reliable: disconnect from Xcode (run app standalone), then repeat steps 3–4.
Observed behavior
- Crash occurs (intermittent in UI, but reliable when reproducing under certain conditions).
- In our testing: crash often happens the first time after tapping Play Both; subsequent launches may work until a clean install / clean build cycle.
- Uninstalling the app, cleaning the Xcode build, and repeating the steps can make the crash reappear.
- Running without the debugger attached makes the crash more likely (always crashes in our scenario).
Expected behavior
No crash when playing/pausing multiple RiveViewModel instances and toggling view visibility.
Minimal reproduction
We prepared a small standalone iOS demo that only contains:
- Two
VitanaChatButtonviews, each with:- One
RiveViewModelfor a full-background.riv - One
RiveViewModelfor an icon.riv
- One
RiveViewModel(fileName:…, autoPlay: false), views created withcreateRiveView()- Heavy setup deferred with
DispatchQueue.main.asyncfromdidMoveToWindow play()/pause()on both view models
**Repository **: https://github.com/wanqingrongruo/rive-crash-demo
Additional notes
- Please let us know if
RiveExperimentalSPI or the deferreddidMoveToWindowsetup is relevant; we can simplify the demo further if needed. - Crash log / backtrace: I will attach a symbolicated crash report and/or Xcode organizer crash in a follow-up comment.
Attachments
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked minimal reproduction on a physical iPhone 11 with RiveRuntime 6.17.0, exercising Play Both and Toggle Large Visible both with and without Xcode attached. Read the promised symbolicated crash report when available and trace the RiveViewModel/createRiveView lifecycle around didMoveToWindow and play/pause; done means those steps no longer crash after clean install/build cycles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100