Skip to content

image can't show when integrate with existing apps in android #13197

Closed
@woshi82

Description

@woshi82

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

  1. follow the steps in document.

  2. run command below in my terminal
    npm start
    ./gradlew installDebug

    it shows:
    image

  3. 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

  4. so i delete the code in NavigationHeaderBackButton.js

    <Image style={[styles.button, props.imageStyle]} source={require('./assets/back-icon.png')} />

​ the app start successfully.

  1. added some image in index.android.js. (certainly, have added avatar.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'}} />

the image still can't show.
image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions