10
votes

While running ReactNative Android app getting the below Exception and also while Bundle, getting the same exception.

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

Unable to resolve module DatePickerIOS from Project_Path/node_modules/react-native/Libraries/react-native/react-native-implementation.js: Module DatePickerIOS does not exist in the Haste module map

Kindly help me to resolve this.enter image description here

Package.json: "dependencies": { "react": "16.3.1", "react-native": "0.55.2", "react-native-calendars": "1.17.7", "react-native-carousel-view": "0.5.1", "react-native-confirmation-code-input": "1.0.4", "react-native-dash": "0.0.8", "react-native-elements": "0.19.1", "react-native-fbsdk": "0.7.0", "react-native-google-places-autocomplete": "1.3.6", "react-native-google-sign-in": "1.0.16", "react-native-i18n": "2.0.12", "react-native-indicators": "0.12.0", "react-native-maps": "0.21.0", "react-native-material-bottom-navigation": "0.9.0", "react-native-material-dropdown": "0.11.1", "react-native-material-ui": "1.22.1", "react-native-modalbox": "1.4.2", "react-native-searchbar": "1.14.0", "react-native-sensitive-info": "5.1.0", "react-native-splash-screen": "3.0.6", "react-native-vector-icons": "4.6.0", "react-navigation": "1.5.11", "react-native-tab-view": "0.0.77", "react-native-global-props": "1.1.3" }

3
Checkout this link - Pritish Vaidya
Atlast it got worked by npm start -- --reset-cache - Tech Mahesh

3 Answers

21
votes

Terminate the process in the Metro bundler terminal window, and then as pointed out in the comments run npm start -- --reset-cache

1
votes

What happened with me for this problem,

I encountered this problem twice,

first time i mistakenly imported a js package when it was not installed, it resolved by removing that mistaken import statement

second time i was trying to install 'react-native-modal-overlay' package, and instead of using npm install, i used yarn add react-native-modal-overlay,

and I started getting this problem

tried all steps i could find on net, but not resolved, finally, I took a fresh install of repository in another package, -----then also the build failed, t

-- then i ran npm cache clean, ( the result asked to run command 'npm install --cache /tmp/empty-cache' -- i ran this command, and then tried to make build it succeeded

1
votes

if above accepted answer not works in that case. simply use

npm install DatePickerIOS

Above issue can be occur with any lib then simply use

npm install "Error module name"