error: bundling failed: Error: Unable to resolve module `AccessibilityInfo` from `

错误1:

The development server returned response error code: 500

URL: http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false

error: bundling failed: Error: Unable to resolve module `AccessibilityInfo` from `_第1张图片

错误2:

Loading dependency graph, done.

error: bundling failed: Error: Unable to resolve module `AccessibilityInfo` from `D:\ReactNative\RNApp\node_modules\reac

t-native\Libraries\react-native\react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste

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 /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.

error: bundling failed: Error: Unable to resolve module `AccessibilityInfo` from `_第2张图片

错误原因:

通过react-native -v查看当前使用的react-native是最新版本0.56

D:\Test\ss>react-native -v
react-native-cli: 2.0.1
react-native: 0.56

解决方案:

开始按照错误提示“npm rm watcchman  hahswatch-del-all”... 4步骤结果还是不对;

当前安装的react-native-cli的版本为2.0.1 对应react-native版本为0.56.0有bug,

使用react-native版本0.55.4解决:

进入项目目录,依次执行:

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

 

你可能感兴趣的:(Android开发,React,Native开发)