Closed leonschrijvers closed 4 months ago
Closing this issue as it was resolved with the developer. Notable changes were made to the runtime to help with this crash in releases v5.14.3 and v5.14.4.
Note: if you are seeing a similar stack trace to above, a workaround is, if you are not utilizing RiveView.stateMachineDelegate
, set it to nil
before your animation is set up, with one option being subclassing RiveViewModel
, and overriding createRiveView
:
class CustomViewModel: RiveViewModel {
override func createRiveView() -> RiveView {
let view = super.createRiveView()
view.stateMachineDelegate = nil
return view
}
}
Additionally, check naming within your state machine; sometimes certain characters are not decoded properly, and cause an attempted insertion of a nil
value, causing this crash.
Description
Application crashes (EXC_CRASH (SIGABRT)) when displaying an animation with state machine in SwiftUI.
Some of our users have reported an immediate application crash when a Rive animation is displayed. Analysis of crash reports indicate that this is caused by a call from the RiveRuntime framework, causing a
NSInvalidArgumentException
, see snippet below: (Full crash reports are available if needed)Provide a Repro
This is a stripped down version of our code. Note that state machine inputs have been anonimized, but the logic is the same as we use in our application. If needed, we can privately share our production code and
.riv
/.rev
file.Expected behavior
Present the animation without any crashes.
Device & Versions (please complete the following information)
Additional context
Unfortunately, we cannot reproduce this issue ourselves, which makes it hard to troubleshoot. However, several users have experienced this unexpected behavior. We are open to test/validate any suggestions with our test users.