2016-12-27 94 views
0

将升级项目升级到版本0.39后Android即时通讯:Error: Requiring unknown module "0". If you sure module is there, try restarting the packager or running "npm install""。和iOS:React-native升级到版本0.39后无法构建

2016-12-27 12:08:14.802 [info][tid:main][RCTBatchedBridge.m:72] Initializing <RCTBatchedBridge: 0x608000380750> (parent: <RCTBridge: 0x6080000a5d00>, executor: RCTJSCExecutor) 
2016-12-27 12:08:15.749 [warn][tid:com.facebook.react.JavaScript][RCTBatchedBridge.m:505] Failed to execute source code: Unhandled JS Exception: Error 
2016-12-27 12:08:15.750 [fatal][tid:main] Unhandled JS Exception: Error 
2016-12-27 12:08:15.751 [98772:687954] -[RCTJSStackFrame objectForKeyedSubscript:]: unrecognized selector sent to instance 0x60000004f6f0 
+0

请显示代码 – Codesingh

回答

1

你可能有你的本地代码和JavaScript代码之间的不匹配。清除所有的缓存,这样您在构建和运行一个干净的应用程序:

  • 删除您node_modules夹,然后运行“故宫安装”了(或者,如果你想这一步要快用纱线)。确保package.json指定您期望的React Native的最新版本。
  • 删除你的Android“build”文件夹(“git clean -dfxn”可能有助于找到它们)和你的全球iOS“DerivedData”文件夹(大量指南在线)
  • 从iOS模拟器或iPhone卸载你的应用程序
  • 与“守望手表删除所有”
  • 开始删除应用数据在Android设备上并卸载你的应用程序
  • 清除您的守望状态做出反应以“NPM启动本地服务器 - --reset缓存“清除打包程序缓存

然后再次构建并运行您的应用程序。

0

这是由于我使用的React与React-Native的所需版本之间的差异造成的。因此,使用npm list命令发现了该问题。之后,只需运行npm install [email protected]其中X.Y是版本。

相关问题