Description
Description
When i integrate with existing apps in android , the image cannot show,instead errors.
The android project is just a simplest project generated by Android studio
through the start a new Android studio project
option.
i just follow the steps in document. http://facebook.github.io/react-native/docs/integration-with-existing-apps.html
Reproduction Steps and Sample Code
-
follow the steps in document.
-
run command below in my terminal
npm start
./gradlew installDebug
-
try the method provided in Error on load image on React-native: Unexpected character #6691 ,but nothing worked.
method 1:
watchman watch-del-all
then restart my packager with the --resetCache option
method 2:
restart my editor、genymotion many times -
so i delete the code in
NavigationHeaderBackButton.js
<Image style={[styles.button, props.imageStyle]} source={require('./assets/back-icon.png')} />
the app start successfully.
-
added some image in
index.android.js
. (certainly, have addedavatar.png
in my project folder).<Image width={200} height={200} source={require('./avatar.png')} />
or
<Image width={200} height={200} source={{uri: 'https://c4.biketo.com/racegood-com/position_data/58cf482230405.jpg'}} />
Solution
i just searched in stackoverflow
http://stackoverflow.com/questions/42120879/react-native-integration-with-existing-apps-and-images
but didn't find the solution.
i don't know whether there are some bugs in react native ? or somthing goes wrong in my project?
Additional Information
- React version: 15.4.2
- React Native version: 0.42.3
- Platform: [FILL THIS OUT: Android]
- Development Operating System: [MacOS]
- Dev tools: targetSdkVersion 23