react native run-android 錯(cuò)誤一則
react-native run-android 時(shí),報(bào)如下錯(cuò)誤:
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的版本問題。
解決方法:刪除這個(gè)文件,刪前記得備份。
./node_modules/react-native/local-cli/core/__fixtures__/files/package.json