2016-12-27 53 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是版本。

相關問題