candlefinance / faster-image

Fast image loading for React Native backed by performant native libraries.
https://candle.fi/discord
MIT License
596 stars 28 forks source link

[Question] Android "failed to load image" on version 1.6.2 #64

Closed elsieej closed 3 weeks ago

elsieej commented 4 weeks ago

React Native Info:

Info Fetching system and libraries information... System: OS: macOS 14.7 CPU: (10) arm64 Apple M1 Pro Memory: 1.22 GB / 32.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.19.1 path: ~/.nvm/versions/node/v18.19.1/bin/node Yarn: Not Found npm: version: 10.2.4 path: ~/.nvm/versions/node/v18.19.1/bin/npm Watchman: version: 2024.10.28.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.15.2 path: /Users/elsie/.rbenv/shims/pod SDKs: iOS SDK: Platforms:

  • DriverKit 23.5
  • iOS 17.5
  • macOS 14.5
  • tvOS 17.5
  • visionOS 1.2
  • watchOS 10.5 Android SDK: Android NDK: 22.1.7171670 IDEs: Android Studio: 2024.2 AI-242.23339.11.2421.12483815 Xcode: version: 15.4/15F31d path: /usr/bin/xcodebuild Languages: Java: version: 17.0.13 path: /usr/bin/javac Ruby: version: 2.7.4 path: /Users/elsie/.rbenv/shims/ruby npmPackages: "@react-native-community/cli": installed: 15.0.0 wanted: 15.0.0 react: installed: 18.3.1 wanted: 18.3.1 react-native: installed: 0.76.1 wanted: 0.76.1 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: true iOS: hermesEnabled: true newArchEnabled: true

Hi, i have problem when get image from remote with "Authorization Header" in Android (IOS work perfectly), my config with FasterImageView:

const ImageComponent = ({...rest}: Props) => { const { auth: {accessToken}, } = useAuthContext(); const source: ImageOptions = { ...rest.source, headers: { Authorization: Bearer ${accessToken}, }, cachePolicy: 'discNoCacheControl', }; return ( <FasterImageView {...rest} source={source} onError={e => console.log(e)} /> ); };

and i see my response from remote is: content-length: 62769 content-type: image/jpeg date: Wed, 30 Oct 2024 10:45:30 GMT last-modified: Wed, 30 Oct 2024 10:45:04 GMT server: Kestrel

When i followed Kotlin code where raised the error, i think Coil required the response always have "Cache-Control" or anything else, right?

Many tks for providing library.

gtokman commented 3 weeks ago

Can you try the latest version.