React-Native:模块AppRegistry不是注册的可调用模块 [英] React-Native: Module AppRegistry is not a registered callable module
问题描述
我目前正在尝试让 ES6反应-native-webpack-server 运行
在Android模拟器上.区别在于我已经升级了package.json
和build.grade
以使用react 0.18.0
,并且在启动时遇到此错误.据我所知AppRegistry
已正确导入.即使我将代码注释掉,该错误仍然会出现.这确实可以在iOS上正常运行.
I'm currently trying to get the ES6 react-native-webpack-server running
on an Android emulator. The difference is I've upgraded my package.json
and build.grade
to use react 0.18.0
, and am getting this error on boot. As far as I'm aware AppRegistry
is imported correctly. Even if I were to comment out the code this error still comes up. This does work on iOS without issue.
我在做什么错了?
尝试其他确实支持0.18.0的样板之后,我仍然遇到相同的问题.
After trying other boilerplates that do support 0.18.0, I'm still coming across the same issue.
推荐答案
今天,我刚升级为本机0.18.1
,很难解决0.19.0-rc
的预发行版本的一些同级依赖问题.
i just upgraded to react-native 0.18.1
today tough having some peer dependencies issues with 0.19.0-rc
pre-release version.
回到您的问题,我做了什么
Back to your question, what I did was
-
cd android
-
sudo ./gradlew clean
(有关清洁工作原理的更多信息,请此处)
cd android
sudo ./gradlew clean
(more information about how clean works here)
然后返回工作目录并运行
react-native run-android
then back to the working directory and run
react-native run-android
在升级之后,您也应该重新启动npm.
you should restart your npm too after that upgrade.
希望这对您有用.
这篇关于React-Native:模块AppRegistry不是注册的可调用模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!