rive-app / rive-app/rive-react-native
fireStateAtPath crashes on Android
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 783
- Forks
- 81
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 3
Description
Description
The app (expo client) crashes when trying to use fireStateAtPath
Provide a Repro
The issue seems to be that it doesn't find the StateMachine in the native side.
Sadly I cannot provide a riv file but it works on both iOS and web - with fireStateAtPath - so the riv file is fine.
fireState also works fine
const fireStateOrfireStateAtPath = (stateName: string) => {
if (stateName.includes("/")) {
const [state, ...path] = stateName.split("/").reverse();
riveRef.current?.fireStateAtPath(state, path.reverse().join("/"));
} else {
riveRef.current?.fireState(stateMachineName, stateName);
}
};
Any ideas? Thank you ❤️
Logcat
08-30 10:37:22.779 32224 1111 F p.myapp.debu: java_vm_ext.cc:578] JNI DETECTED ERROR IN APPLICATION: JNI CallVoidMethodV called with pending exception app.rive.runtime.kotlin.core.errors.StateMachineException: No StateMachine found with name .
08-30 10:37:22.779 32224 1111 F p.myapp.debu: java_vm_ext.cc:578] at app.rive.runtime.kotlin.core.StateMachineInstance app.rive.runtime.kotlin.core.Artboard.stateMachine(java.lang.String) (Artboard.kt:137)
08-30 10:37:22.779 32224 1111 F p.myapp.debu: java_vm_ext.cc:578] at java.util.List app.rive.runtime.kotlin.controllers.RiveFileController.getOrCreateStateMachines(java.lang.String) (RiveFileController.kt:607)
08-30 10:37:22.779 32224 1111 F p.myapp.debu: java_vm_ext.cc:578] at void app.rive.runtime.kotlin.controllers.RiveFileController.processAllInputs() (RiveFileController.kt:523)
08-30 10:37:22.779 32224 1111 F p.myapp.debu: java_vm_ext.cc:578] at void app.rive.runtime.kotlin.controllers.RiveFileController.advance(float) (RiveFileController.kt:264)
08-30 10:37:22.779 32224 1111 F p.myapp.debu: java_vm_ext.cc:578] at void app.rive.runtime.kotlin.renderers.RiveArtboardRenderer.advance(float) (RiveArtboardRenderer.kt:51)
08-30 10:37:22.779 32224 1111 F p.myapp.debu: java_vm_ext.cc:578]
08-30 10:37:22.779 32224 1111 F p.myapp.debu: java_vm_ext.cc:578] in call to CallVoidMethodV
08-30 10:37:22.780 779 855 D EnterpriseController: netId is 0
08-30 10:37:22.780 779 855 E Netd : getNetworkForDns: getNetId from enterpriseCtrl is netid 0
08-30 10:37:22.780 779 855 D DnsProxyListener: DNSDBG::dns addrinfo af 0 - 10252
08-30 10:37:22.813 779 1112 E ResolverController: No valid NAT64 prefix (602, <unspecified>/0)
08-30 10:37:22.974 32224 1111 F p.myapp.debu: thread.cc:2348] No pending exception expected: app.rive.runtime.kotlin.core.errors.StateMachineException: No StateMachine found with name .
08-30 10:37:22.974 32224 1111 F p.myapp.debu: thread.cc:2348] at app.rive.runtime.kotlin.core.StateMachineInstance app.rive.runtime.kotlin.core.Artboard.stateMachine(java.lang.String) (Artboard.kt:137)
08-30 10:37:22.974 32224 1111 F p.myapp.debu: thread.cc:2348] at java.util.List app.rive.runtime.kotlin.controllers.RiveFileController.getOrCreateStateMachines(java.lang.String) (RiveFileController.kt:607)
08-30 10:37:22.974 32224 1111 F p.myapp.debu: thread.cc:2348] at void app.rive.runtime.kotlin.controllers.RiveFileController.processAllInputs() (RiveFileController.kt:523)
08-30 10:37:22.974 32224 1111 F p.myapp.debu: thread.cc:2348] at void app.rive.runtime.kotlin.controllers.RiveFileController.advance(float) (RiveFileController.kt:264)
08-30 10:37:22.974 32224 1111 F p.myapp.debu: thread.cc:2348] at void app.rive.runtime.kotlin.renderers.RiveArtboardRenderer.advance(float) (RiveArtboardRenderer.kt:51)
08-30 10:37:22.974 32224 1111 F p.myapp.debu: thread.cc:2348]
08-30 10:37:22.996 32224 1111 F p.myapp.debu: runtime.cc:642] Runtime aborting --- recursively, so no thread-specific detail!
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 tracing fireStateAtPath through the Android path and inspect the stack-trace locations in Artboard.kt and RiveFileController.kt, especially getOrCreateStateMachines and processAllInputs. Confirm the Android implementation handles the state-machine path without looking up an empty name; done means fireStateAtPath no longer crashes while fireState continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin, react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100