Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS physical device shows no SVG images, Android works #11

Open
thijssmudde opened this issue Apr 1, 2018 · 5 comments
Open

iOS physical device shows no SVG images, Android works #11

thijssmudde opened this issue Apr 1, 2018 · 5 comments

Comments

@thijssmudde
Copy link

The iOS simulator works exactly as intended. However, the SVG images are not shown when loaded on Expo on a physical iOS device. It works on Android however.

I have a project where this error is shown:
https://exp.host/@fullhdpixel/groenteboer

Test it here:
https://expo.io/appetize-simulator?url=https://expo.io/@fullhdpixel/groenteboer

Usage in App

<Product source={Images.peren}/>

Here is the styled component

import styled from 'styled-components'
import normalize from '../Helpers/normalizeSize'

export const Product = styled.Image`
  flex: 1;
  width: null;
  height: ${normalize(130)}px;
  width: 100%;
`

Images.js

peren: require('../Assets/Images/Products/peren.png'),

@rahulpatel
Copy link

👍 on this, I'm seeing the same issue.

@fullhdpixel did you find the cause of this?

@ismnoiet
Copy link

@rahulpatel I'm experiencing the same issue, I think it is because the image is imported from another file, here is an example:

// images.js
export default {
  MY_IMAGE: require('../path_to_svg_image'),
};

// MyComponent.js
import { MY_IMAGE } from '../config/images';
// ...
<Image source={MY_IMAGE} /> // this won't work
<Image source={require('../path_to_svg_image')} /> // this will work

@vatichild
Copy link

put <meta name="viewport" content="width=device-width, initial-scale=1">
between <head></head> in node_modules/react-native-remote-svg/SvgImage.js

@nrajiv84
Copy link

nrajiv84 commented Oct 3, 2022

put <meta name="viewport" content="width=device-width, initial-scale=1"> between <head></head> in node_modules/react-native-remote-svg/SvgImage.js

@Vatia13 For running in local we can manually add in node modules. But how could we achieve this in staging environments and production ?

@melnikovkolya
Copy link

@vatichild Thank you very much for this fix.

Do you plan to make a pull request with this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants