react-native-fast-image: Image not show on android, but still working on IOS
Describe the bug When I show image with url, android device not showing but still show on IOS
<FastImage
source={{uri: 'https://via.placeholder.com/150/810b14'}
style={style}
resizeMode={resizeMode}
onLoadStart={this.onLoadStart}
onLoadEnd={this.onLoadEnd}
/>
Dependency versions
- React Native version: 0.62.2
- React Native Fast Image version: 8.3.0
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 21
- Comments: 38 (2 by maintainers)
Regarding my comments above I meant
It doesn’t work with v7.0.0 for me.
Glide fails, here is the log from my phone:
This is the code to reproduce
In my case, this problem is caused by not sending cookies to the server. I’m using axios(which uses
XMLHttpRequestinternally) to request session, and I solved this problem by simply installingrn-fetch-blob, which includes polyfills ofXMLHttpRequest.Maybe we could add
rn-fetch-blobas a dependency/peerDependency of this library.Can this be a problem specifically related to images from
placeholder.com? We are facing the same issue, this urlhttps://via.placeholder.com/300/09f/fff.pngworks in the browser and on iOS but does not display the image on Android. When<FastImage />is swapped with RN<Image />on Android, the same url works fine as well.Try Commenting cache if you are using this works for me!
cache:FastImage.cacheControl.cacheOnlyIn my case, if the FastImage view is being resized while an image is loading, then it will cause the image to fail to load without triggering any callbacks, including any other FastImage views on the same screen. Can workaround these cases by enabling
fallbackwhich will use react-nativeImageinstead.I am having this issue on Android 10, with RNFI version of 8.3.4.
I have just experienced this too. I have just upgraded to version
8.2.0. There is no problem on iOS, only not show on Android. It also triggersonErrorbut I haven’t checked yet whether there is a message.Note that before I upgraded to
8.2.0I was at7.0.2and there was the exact same issue (image doesn’t show on Android).@dragonlong206 I haven’t resolved yet. I am currently using
fallbackprop as @mdoesburg suggests while digging into solution.Happens when upgrading package from 8.2.0 to 8.2.1+. Must be related to this bug fix. I am using local images and I experience the images disappearing on Android.
Current workaround is to lock version to 8.2.0.
It might be worth noting that I do use the fallback prop which is what the bug fix is related to:
The bug fix description:
iOS image has its own properties for cache and if fallback is true and regular image is being rendered we can’t set FastImage’s cache value because it doesn’t match.
@DylanVann Maybe the fix would be to check if the OS is actually iOS, since I only use fallback for Android, and this bug fix is specifically only targeting iOS?
Any helps? I still stuck at this