I am trying to use some images in my reaction based project.
My project has the following structure:
./index.android.js ./images/icon.png
I am trying to load an image inside a view in index.android.js:
<View> <Image source={require('./images/icon.png')} style={styles.icon} /> </View>
I know that images are found because I am not getting any errors (if I try to claim a nonexistent image that I am making). But, nevertheless, the images do not load, and this is an empty box in which the image should be.
What am I doing wrong? I am using native-native 0.15.0 using a mobile device for testing.
Update:
So, I found this in my build.gradle file for my application:
* // where to put drawable resources / React Native assets, eg the ones you use via * // require('./image.png')), in debug mode * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
My images are not in this folder. I suppose a problem?
Nirri source share