我刚刚使用“react-native init NameProject”创建了应用程序,并且有一个我经常使用的基本目录,所以当我插入它时,我安装了依赖项和链接,它发生在我身上......我已经删除了“node_modules”目录,重新安装,重新链接,似乎没有解决问题......
截屏:
尝试运行命令
react-native link react-native-device-info
or
cd ios && pod install && cd ..
然后尝试使用您用于启动应用程序的命令再次运行您的项目react-native run-android
or react-native run-ios
或者直接从 XCode 运行应用程序。
Because starting react-native 0.60.0 or newer, most but NOT all libraries can auto-link their native modules without running react-native link package_name
. And from what I've tried myself, since react-native-device-info isn't very actively updating themselves, because there isn't much reason to, they doesn't support the auto-link thing (turns out they do https://github.com/react-native-community/react-native-device-info#linking, but maybe on some project it doesn't work as well? at least it doesn't on mine, and I need to link it manually).
实际上,如果您真的尝试仔细阅读它,错误消息本身已经很好地描述了如何解决您的问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)