React Native 0.66.2在没有Hermes的情况下可以完美地工作。
当我启用Hermes :hermes_enabled => true时,打包器不高兴。
我得到了这个错误:
ERROR SyntaxError: 5:1:invalid statement encountered., js engine: hermes
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes


我再次尝试链接所有本机库(如here所说),但没有成功:(
任何帮助都是非常受欢迎的
发布于 2021-11-24 22:31:28
启用hermes后,您必须清理并重新构建项目,如果项目为possible.Otherwise,则会导致一些错误。为了进行清理,您可以使用以下命令。
首先,在您的项目根目录下输入“cd android”进入android,然后运行以下命令
./gradlew clean您还可以使用以下命令重置react原生缓存和npm缓存。
react-native start --reset-cache
npm start -- --reset-cache最后,尝试清理android目录中的构建文件并重新构建项目。
发布于 2021-11-27 18:55:04
删除您的node_modules目录并运行npm i
用于安卓的
cd android && ./gradlew clean && cd ..
(windows) cd android && gradlew clean && cd ..
对于iOS
cd ios && rm -rf Pods && pod cache clean --all && pod install && cd ..
运行react-native start --reset-cache的
https://stackoverflow.com/questions/70016386
复制相似问题