[Windows] Static local image
I have a problem with the new asset system on Windows : http://stackoverflow.com/questions/33778766/react-native-android-static-local-image/33780354?noredirect=1#comment55335206_33780354
I have a file index.android.js in my repository App with this code :
<Image source={require('./house.png')} style={styles.image}/>
It works if I put my image in App and in App/assets. If I just put my image in App, it doesn't work.
Then, I want write my code like this :
<Image source={require('./img/house.png')} style={styles.image}/>
But, if I put my image in App/img, it doesn't work. Even if I add my image in App/assets/img, it doesn't work.
I have the same issue here. The problem seems to be that react is generating invalid requests to the packager.
The asset provider (packager) serves the files well, but the request that comes from the app adds an additional dash to the URL, making it invalid.
Any solution for this?
Changing the line (packager/react-packager/src/Bundler/index.js)
httpServerLocation: path.join('/assets', path.dirname(relPath)),
to
httpServerLocation: path.join('assets', path.dirname(relPath)),
Location: https://github.com/facebook/react-native/blob/b907f40957bbd822cfab3a56d82363ffd58d2e78/packager/react-packager/src/Bundler/index.js#L306
This solves the issue, but I'm not sure if it will create additional issues on other platforms tho.
@WoLfulus It's ok for us now on Windows with your information. Thinks
@WoLfulus Thanks for your help.