Skip to content

Conversation

@ckknight
Copy link
Contributor

This updates the definition of RiveReactNativeView.downloadUrlAsset to load file:// URLs via java.io.File

Formerly, if a file:// URL was loaded, that would lead to com.android.volley.VolleyError: java.lang.ClassCastException: sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection

This only affects Android apps built in release mode, as debug mode is unaffected.

This updates the definition of `RiveReactNativeView.downloadUrlAsset` to load `file://` URLs via `java.io.File`

Formerly, if a `file://` URL was loaded, that would lead to `com.android.volley.VolleyError: java.lang.ClassCastException: sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection`

This only affects Android apps built in release mode, as debug mode is unaffected.
@CacaoRick
Copy link

Before this change, I receive error when run an eas update bundle:

{
  "type": "IncorrectRiveFileUrl",
  "message": "Unable to download the Rive asset file form file:///data/user/0/com.rick.liao.riveapp/files/.expo-internal/49af8dbfa5974adf091e4d50f51edfdb.riv"
}

I can confirm that using this commit allows the local Rive file to be correctly loaded in EAS Update.

@joaqo
Copy link

joaqo commented Sep 11, 2025

Can't for the life of me make this work, is it supposed to just be something like this?

On my component

      <Rive
        url="file://assets/rive/logo.riv"
        style={{ width: 400, height: 400 }}
      />

On app.json under plugins

      [
        "expo-asset",
        {
          "assets": ["./assets/rive/logo.riv"]
        }
      ]

I have checked that the asset is loaded correctly by expo assets, and the rive component works perfectly with https:// urls, so no idea what the issue is.

@Hanro50
Copy link

Hanro50 commented Oct 10, 2025

I used this as a patch on Rive React Native version 9.6.1
It works well and allows Rive files to be used with Expo update on Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants