Error: "Unable to resolve module `AccessibilityInfo`" after upgrading to 1.3.1
After upgrading to version 1.3.1 I'm getting this error both on Android and iOS builds. I had to go back to 1.3.0 in the meantime.
Unable to resolve module `AccessibilityInfo` from `/Users/ci/agent/vstsagent/_work/1/s/InfotycoonMobile/node_modules/react-native/Libraries/react-native/react-native-implementation.js`: Module does not exist in the module map or in these directories:
/Users/ci/agent/vstsagent/_work/1/s/InfotycoonMobile/node_modules/react-native/node_modules
, /Users/ci/agent/vstsagent/_work/1/s/InfotycoonMobile/node_modules
, /Users/ci/agent/vstsagent/_work/node_modules
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 packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.
I have cleaned npm cache, deleted node modules and deleted temp files from packager. This happens also on the CI environment which always starts fresh.
My package.json looks like this:
"dependencies": {
"axios": "^0.16.2",
"lodash": "^4.17.4",
"mobile-center": "^0.7.0",
"mobile-center-analytics": "^0.7.0",
"mobile-center-crashes": "^0.7.0",
"mobile-center-push": "^0.7.0",
"moment": "^2.18.1",
"native-base": "2.2.0",
"react": "16.0.0-alpha.6",
"react-native": "0.44.3",
"react-native-accordion": "compojoom/react-native-accordion.git#compojoom-fixes",
"react-native-couchbase-lite": "^0.6.0",
"react-native-datepicker": "^1.6.0",
"react-native-device-info": "^0.10.2",
"react-native-fetch-blob": "^0.10.8",
"react-native-fs": "^2.3.3",
"react-native-image-crop-picker": "0.15.1",
"react-native-mail": "^3.0.4",
"react-native-pdf": "1.3.0",
"react-native-popover-tooltip": "^1.0.6",
"react-native-router-flux": "3.39.2",
"react-native-signature-capture": "^0.4.6",
"react-native-tab-view": "0.0.67",
"react-native-vector-icons": "^4.2.0",
"react-native-zip-archive": "^2.0.0",
"react-tween-state": "^0.1.5",
"react-native-permissions": "1.0.0"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-plugin-module-resolver": "^2.7.1",
"babel-preset-react-native": "1.9.2",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.6"
}
Is this a bug or am I missing some step for this version?
'react-native-pdf' v1.3.x need RN 0.47.x, thought you can run v1.3.0 with RN 0.44.3. 'react-native-pdf' does not need 'AccessibilityInfo', 'AccessibilityInfo' is a built-in module of react-native from v0.47.0, But your "react-native" is still "0.44.3", Version up to 0.47.x will fix it.
In v1.3.1, I have added dependency on RN 0.47.0
You can modify local file: node_modules/react-native-pdf/package.json
delete the line in dependencies:
"react-native": "^0.47.0"
and try again.