Rive MalformedFileException
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- android, kotlin, react-native, typescript
- Domain
- mobile
Research direction
Start by reproducing the crash with the provided remote .riv URL and inspect File.kt:30, RiveAnimationView.kt:385, and RiveAnimationView.loadFileFromResource from the stack trace. Compare remote loading with a local asset and determine why the remote file reaches MalformedFileException; done means the remote animation no longer crashes and the reported load failure is handled.
Written by the indexing model from the issue text.
Description
### Description
App is crashing in production when trying to render a Rive animation from a remote `.riv` file.
Crash logs point to a native failure after loading the remote Rive URL:
```
https://cdn.jsdelivr.net/gh/shubham-k2/assets@main/Updated%20surprise_sale_banner.riv
```
The crash happens inside this stack trace:
```
Thread Name: app.rive.runtime.kotlin.core.errors.MalformedFileException
app.rive.runtime.kotlin.core.File.import (Native Method:0)
app.rive.runtime.kotlin.core.File. (File.kt:30)
app.rive.runtime.kotlin.RiveAnimationView.loadFileFromResource (RiveAnimationView.kt:385)
app.rive.runtime.kotlin.RiveAnimationView.onAttachedToWindow (RiveAnimationView.kt:880)
android.view.View.dispatchAttachedToWindow (View.java:21976)
android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:4302)
android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:4302)
android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:4302)
android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:4302)
android.view.ViewGroup.addViewInner (ViewGroup.java:6127)
android.view.ViewGroup.addView (ViewGroup.java:5903)
com.facebook.react.views.view.ReactViewGroup.addView (ReactViewGroup.java:543)
android.view.ViewGroup.addView (ViewGroup.java:5843)
com.facebook.react.views.view.ReactClippingViewManager.addView (ReactClippingViewManager.java:40)
com.facebook.react.views.view.ReactClippingViewManager.addView (ReactClippingViewManager.java:20)
com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren (NativeViewHierarchyManager.java:533)
com.swmansion.reanimated.layoutReanimation.ReanimatedNativeHierarchyManager.manageChildren (ReanimatedNativeHierarchyManager.java:409)
com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute (UIViewOperationQueue.java:183)
com.facebook.react.uimanager.UIViewOperationQueue$1.run (UIViewOperationQueue.java:910)
com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches (UIViewOperationQueue.java:1023)
com.facebook.react.uimanager.UIViewOperationQueue.-$$Nest$mflushPendingBatches (Unknown Source:0)
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded (UIViewOperationQueue.java:1083)
com.facebook.react.uimanager.GuardedFrameCallback.doFrame (GuardedFrameCallback.java:29)
com.facebook.react.modules.core.ReactChoreographer$1.doFrame (ReactChoreographer.java:89)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:1106)
android.view.Choreographer.doCallbacks (Choreographer.java:866)
android.view.Choreographer.doFrame (Choreographer.java:792)
android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1092)
android.os.Handler.handleCallback (Handler.java:938)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:226)
android.os.Looper.loop (Looper.java:313)
android.app.ActivityThread.main (ActivityThread.java:8751)
java.lang.reflect.Method.invoke (Native Method:0)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135)
```
We are using `rive-react-native` 9.2.1 with React Native 0.74.7.
### Provide a Repro
Minimal component that crashes in production when `sourceUrl` is remote:
```tsx
{
console.error('Rive file load failed');
}}
url="https://cdn.jsdelivr.net/gh/shubham-k2/assets@main/Updated%20surprise_sale_banner.riv"
/>
```
This happens **only** with remote `.riv` URLs; local assets load correctly.
#### Source `.riv`/`.rev` file
You can test this with:
[https://cdn.jsdelivr.net/gh/shubham-k2/assets@main/Updated%20surprise_sale_banner.riv]
We can share the `.rev` file privately if needed.
### Expected behavior
Rive animation should load and play from the remote URL without crashing.
#### Screenshots
_No screenshots available since this is a native crash._
### Device & Versions (please complete the following information)
- Device: Android (various production devices)
- OS: Android 10–14
- React Native: 0.74.7
- rive-react-native: 9.2.1
#### Additional context
- App uses Reanimated and other common animation libraries.
- Local `.riv` assets work perfectly.
- Crashes only occur on remote file loading.
- Dominant language
- TypeScript
- Stars
- 783
- Forks
- 81
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 3
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.
More from rive-app/rive-react-native
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rive-app/rive-react-native#433 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
rive-app/rive-react-native#431 · 2 comments ·
-
[Android] Rive events dispatched off the UI thread can deadlock with Reanimated under Fabric (ANR) Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
rive-app/rive-react-native#444 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
rive-app/rive-react-native#441 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rive-app/rive-react-native#440 ·
All issues in rive-app/rive-react-native
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·