seekshiva / react-native-remote-svg

Adds support for loading svg images in React Native
MIT License
184 stars 71 forks source link

Android SVGs not showing w/ Chrome 72 #30

Closed zivester closed 5 years ago

zivester commented 5 years ago

Overnight my react-native Android application stopped showing remote svgs using this lib (iOS is fine). My application was not updated, but other apps were (Chrome from 71 -> 72). This immediately broke my app and this lib.

I tracked this bug down to WebView, and hopefully others can follow along here: https://github.com/react-native-community/react-native-webview/issues/298

Currently there is no way to downgrade chrome to get it functional again, but identical phones running Chrome 71 do not exhibit this behavior.

raen79 commented 5 years ago

Apparently converting hex colors to rgb fixes it, I'm trying now

EDIT: YES! this is the solution. Annoying but what can you do...

zivester commented 5 years ago

@raen79 also confirmed, manually changed one of my remote assets from hex to rgb() syntax and it works! Sick.. now where/when/why in the world did hex stop working...

albertogalca commented 5 years ago

Hi guys! How can I reproduce this issue inside the Android Studio simulator? Thanks for the solution!

zivester commented 5 years ago

@albertogallego

import Image from 'react-native-remote-svg';

<Image
  source={{
    uri: 'https://s3.amazonaws.com/cdn.titanvest.com/misc/car-hex.svg'
  }}
/>
zivester commented 5 years ago

Android Webview team confirmed breaking this, with possible workarounds that could be built into this library or upstream in react-native-webview, https://github.com/react-native-community/react-native-webview/issues/298#issuecomment-461109249

SamiChab commented 5 years ago

Try to replace every hex code for colors with rgb() Example: fill:#ffffff; => fill:rgb(255, 255, 255);

manoj-makkuboy commented 5 years ago

Raised a pull request to fix this, meanwhile if you want the fix before release, do npm install seekshiva/react-native-remote-svg#pull/33/head

zivester commented 5 years ago

Chrome team has addressed the issue and the fix is now in the Play store as version 72.0.3626.105. I just updated and everything is working again for me, so I'm going to close.