I am running
react-native bundle --platform windows --dev false --entry-file index.windows.js --bundle-output windows/app/ReactAssets/index.windows.bundle --assets-dest windows/app/ ReactAssets/
command to create release bundle, but I am getting following error
Unable to resolve module `AccessibilityInfo` from `C:\Users\godha.pranay\project\node_modules\react-native\Libraries\react-native\react-native-implementation.js`: Module does not exist in the module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf $TMPDIR/react-*` or `npm start -- --reset-cache`. 4. Remove haste cache: `rm -rf $TMPDIR/haste-map-react-native-packager-*`.
I tried everything recommended on internet, nothing is working. I am totally stuck on it. Please help.
It seems like a bug in 0.56 related to dependencies. The "solution" is to find the correct combination of dependencies' versions. We found a workaround by installing those versions EXACTLY:
react-native >> 0.55.4
babel-core >> latest
babel-loader >> latest
babel-preset-react-native >> 4.0.0
So you have to run those commands in order:
react-native init AwesomeProject
cd AwesomeProject
react-native run-android
npm uninstall react-native
npm install --save [email protected]
react-native run-android
npm install --save babel-core@latest babel-loader@latest
npm uninstall --save babel-preset-react-native
npm install --save [email protected]
react-native run-android
If you are running the reactive-native version 0.56.0 then downgrade it to 0.55.4.
cd "on your project directory"
npm install [email protected]
If you want to know the reason follow this issue.
i had the same issue.
previous my react-native version was
C:\WINDOWS\system32>react-native -v
react-native-cli: 2.0.1
react-native: 0.56.0
then i uninstall react-native
C:\WINDOWS\system32>npm uninstall -g react-native-cli
removed 41 packages in 3.999s
then i installed react-native
npm install [email protected]
again intsalled
npm install -g [email protected]
then this installation of creating react-native project work out
react-native init --version="0.55.4" myprojectname
"dependencies": {
"react": "^16.4.1",
"react-native": "^0.55.4"
},
"devDependencies": {
"babel-preset-react-native": "^4.0.0",
},
then hit following commands
npm update
npm cache clean --force
cd android
gradlew clean
cd..
react-native run-android
Worked for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With