vault-development / react-native-svg-uri

Render SVG images in React Native from an URL or static file
850 stars 334 forks source link

Large size SVG file will cause crash in iOS #143

Closed guoliang1206 closed 5 years ago

guoliang1206 commented 5 years ago

environment: "react": "16.3.1", "react-native": "0.55.4", "react-native-svg": "^6.5.2", "react-native-svg-uri": "^1.2.3",

xcode 9.4.1

if i set a big size svg image , it will cause crash in iOS, (crash at main method)

usage :

<SvgUri width="16" height="16" source={require('../../resources/svg_icon/stepdone_icon.svg')}/>

and the Svg file is here

stepdone_icon.svg.zip

fniwes commented 5 years ago

I was unable to reproduce the error with your image using the ios emulator. I noticed, sometimes, estrange crashes when the phone is with memory pressure (but not related with the plugin). Maybe that is what you are experiencing.

Another suggestion, this plugin depends on react-native-svg which is the plugin that actually display the svg. If you are not in the latest version of that plugin try upgrading it.

guoliang1206 commented 5 years ago

@fniwes Maybe you are right, I guess my view has too much components and costs much resources, I need optimize my view structure. My react-native-svg is the latest version.