react-native run-android 时,报如下错误:
error: bundling failed: Error: While resolving module `react-native-vector-icons/MaterialIcons`, the Haste package `react-native-vector-icons` was found. However the module `MaterialIcons` could not be found within the package. Indeed, none of these files exist:
* `/Users/user/my-app/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
* `/Users/user/my-app/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
google了下,在https://github.com/oblador/react-native-vector-icons/issues/626找到了。
原因可能是React-Native,React,React-native-vector-icons的版本问题。
解决方法:删除这个文件,删前记得备份。
./node_modules/react-native/local-cli/core/__fixtures__/files/package.json