Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Lottie 6.5.1: Source uri to local file not working on android. Error: sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection #1178

Open
Assignees
matinzd
Labels
@howard-lingumi

Description

@howard-lingumi

Description

When upgrading from Expo 49 to Expo 50, Lottie was upgraded from 5.1.6 to 6.5.1. Before the upgrade I was able to use the uri from a local (dynamically downloaded) lottie file however in the newest version this does not work on android. It does still seem to work on iOS.

When logging the error fromanimationFailure I get:Error: sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection.

It should be noted that using a remote url is working correctly, it is only when the uri is from the filesystem. Thank you for all the great work on Lottie, and thanks in advance for any help you are able to provide.

Steps to Reproduce

  1. Create a new react-native project with the latest lottie 6.5.1
  2. Render lottie with a local file uri (see code example)
  3. AddanimationFailure callback and log to console.
  4. Notice lottie doesn't render on an android device.
  5. Notice that the logged error fromanimationFailure is "sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection"
  6. Downgrade lottie to 5.1.6
  7. Notice that same code now works as expected.

Expected behavior: Local lottie animation to render using the LottieView

Actual behavior: No lottie animation was rendered andanimationFailure returned an error (see above)

Minimal reproduction

Minimal Reproduction of issue with Expo 50 and Lottie 6.5.1:https://gitlab.com/howard18/lottie-local-file-uri-repro/-/tree/main/lottie-6-issue
Same code working with Expo 49 and Lottie 5.1.6:https://gitlab.com/howard18/lottie-local-file-uri-repro/-/tree/main/lottie-5-working

React Native Environment

System:
OS: macOS 14.2.1
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 282.30 MB / 32.00 GB
Shell:
version: 3.2.57
path: /bin/bash
Binaries:
Node:
version: 14.21.3
path: ~/.nvm/versions/node/v14.21.3/bin/node
Yarn: Not Found
npm:
version: 6.14.18
path: ~/.nvm/versions/node/v14.21.3/bin/npm
Watchman:
version: 2022.11.14.00
path: /usr/local/bin/watchman
Managers:
CocoaPods:
version: 1.11.3
path: /Users/Howard/.rvm/rubies/ruby-2.7.2/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode:
version: 15.2/15C500b
path: /usr/bin/xcodebuild
Languages:
Java: Not Found
Ruby:
version: 2.7.2
path: /Users/Howard/.rvm/rubies/ruby-2.7.2/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.4
wanted: 0.73.4
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

Lottie Version

Version: 6.5.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp