react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

[Android] SvgUri throws [TypeError: Network request failed] when loading remote SVG

Open Resource-4 opened this issue 9 months ago • 2 comments
trafficstars

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

Resource-4 avatar Jan 22 '25 09:01 Resource-4

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.

jakex7 avatar Jan 22 '25 10:01 jakex7

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

DavitVosk avatar Jan 31 '25 14:01 DavitVosk