react-native-svg
react-native-svg copied to clipboard
[Android] SvgUri throws [TypeError: Network request failed] when loading remote SVG
Description
React Native Version: ^0.76.5 react-native-svg: 15.10.1 Device: Samsung Galaxy S23
it shows the svg image in snack.io but in real device its giving the crash with above error
Steps to reproduce
import React from "react"; import { View } from "react-native"; import { SvgUri } from "react-native-svg";
const Logo = () => { return ( <View style={{ minHeight: 70 }}> <SvgUri style={{ alignSelf: "center" }} uri="https://res.cloudinary.com/ucharge/image/upload/v1733215394/LogoEv_yr27ip.svg" /> </View> ); };
export default Logo;
Snack or a link to a repository
https://snack.expo.dev/G9NpYRDATOYZ-0YucEcrK
SVG version
15.10.1
React Native version
0.76.5
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
Fabric (New Architecture)
Build type
Debug app & dev bundle
Device
Real device
Device model
samsung s23
Acknowledgements
Yes
Thank you for reporting this. However, I'm unable to reproduce the issue. I've tested it on both an emulator and real devices, and the logo appears correctly in both cases. My assumption is that the problem might be related to hosting restrictions, such as geolocation or spam rate limitations, which could be preventing it from loading on your device.
I get the same problem. Always get [TypeError: Network request failed] error on Android. How did you solve the problem @Resource-4 ?
P.S. I am using RN CLI 0.75.4 version
UPDATE: As revealed there was internet connection issue for my Android simulator... SVG is displayed properly after that problem is fixed