Trouble requiring image module in React Native Trouble requiring image module in React Native xcode xcode

Trouble requiring image module in React Native


Since React Native release 0.14 the handling of images has been normalized for iOS and Android and is now different. I could not find any documentation except for this very clear commit note on Github: Document new asset system.

There's only a screenshot of the proposed documentation:enter image description here

Update:There is a link now for the real documentation:https://facebook.github.io/react-native/docs/images.html


I had similar problem, then renamed the image files in file system under the xcode project's Images.xcassets directories with suffixes and capitalization to match the image I'm loading.

For example, if source={require('image!Villagers')} it required the image files named precisely as Villagers.png, Villagers@2x.png and Villagers@3x.png. If the '@3x' part of filename wasn't there, the image would not get found.


What version of React Native are you running? There was an issue with the packager, related to that, that have been solved.

If that's the case, you can either update or run the dev server with:

node_modules/react-native/packager/packager.sh --assetRoots path/to/Images.xcassets

https://github.com/facebook/react-native/issues/282