rive-app / rive-app/rive-ios

Crash on iPhone 11 when playing multiple RiveViewModel instances — first launch / after detach from Xcode

Open
#433 1 comment 0 reactions 0 assignees View on GitHub

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: RiveRuntime 6.17.0 (CocoaPods)
  • Minimum iOS: 15.0
  • Integration: @_spi(RiveExperimental) import RiveRuntime
  • Xcode: Xcode 16.2 (16C5032a)
Steps to reproduce
  1. Build and install the minimal demo on iPhone 11 (see reproduction project below).
  2. Launch the app.
  3. Tap Play Both (starts playback on small button; large button only if visible).
  4. Tap Toggle Large Visible repeatedly.
  5. 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 VitanaChatButton views, each with:
    • One RiveViewModel for a full-background .riv
    • One RiveViewModel for an icon .riv
  • RiveViewModel(fileName:…, autoPlay: false), views created with createRiveView()
  • Heavy setup deferred with DispatchQueue.main.async from didMoveToWindow
  • play() / pause() on both view models

**Repository **: https://github.com/wanqingrongruo/rive-crash-demo

Additional notes
  • Please let us know if RiveExperimental SPI or the deferred didMoveToWindow setup 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
Image

IMG_5197.MOV.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.