Skip to content

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

@wanqingrongruo

Description

@wanqingrongruo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions