Skip to content

Error: running react-native run-ios (back-icon.png doesn't exist) #12062

@ColtHands

Description

@ColtHands
  1. Updating latest watchman and node.
  2. Installing lastest react-native-cli
  3. Initialising react-native project
  4. Using react-native run-ios without any changes
  5. Error

transformed 349/394 (89%)
(node:25247) UnhandledPromiseRejectionWarning: Unhandled promise rejection
(rejection id: 893): UnableToResolveError:Unable to resolve module ./assets/back-icon.png from weekdays/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderBackButton.js: Directory weekdays/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon.png doesn't exist

  • Node: v7.2.0
  • react-native-cli: v4.1.1
  • OSX: ElCapitan: v10.11.5 (15F34)
  • Simulator: iPhone 6 - iOS 10.2 (14C89)
  • Xcode: v8.2.1 (8C1002)

Opening
/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderBackButton.js
and changing
43: <Image style={styles.button} source={require('./assets/back-icon.png')} />
to
43: <Image style={styles.button} />
resolves issue, but i'm pretty sure i should not do that

Reinstalling node_modules inside project directiory, and inside /node_modules/react-native with
npm cache clean
rm -rf node_modules
npm install
doesn't do the trick.

also chaning package.json dependencies react-native from "0.40.0" to "0.38.0" fixes the problem

How to fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions