升级到 0.39 版后未构建 React

编程入门 行业动态 更新时间:2024-10-13 20:18:54
本文介绍了升级到 0.39 版后未构建 React-native的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在 Android 上将项目升级到 0.39 版后,我得到:错误:需要未知模块0".如果您确定模块在那里,请尝试重新启动打包程序或运行npm install"".在 iOS 上:

After upgrade project to version 0.39 on Android im getting: Error: Requiring unknown module "0". If you sure module is there, try restarting the packager or running "npm install"". And on iOS:

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

推荐答案

您的本机代码和 JavaScript 代码可能不匹配.清除所有缓存,以便构建和运行干净的应用程序:

You probably have a mismatch between your native code and your JavaScript code. Clear out all your caches so that you are building and running a clean app:

  • 删除您的 node_modules 文件夹并再次运行npm install"(如果您希望这一步更快,则使用 yarn).确保 package.json 指定了您期望的最新版本的 React Native.
  • 删除您的 Androidbuild"文件夹(git clean -dfxn"可能有助于找到它们)和您的全局 iOSDerivedData"文件夹(许多在线指南)
  • 从 iOS 模拟器或 iPhone 卸载您的应用
  • 在您的 Android 设备上删除您的应用数据并卸载您的应用
  • 使用watchman watch-del-all"清除您的 Watchman 状态
  • 使用npm start -- --reset-cache"启动 React Native 服务器以清除打包器缓存

然后再次构建并运行您的应用.

Then build and run your app again.

更多推荐

升级到 0.39 版后未构建 React

本文发布于:2023-11-25 10:37:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629421.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:升级到   React   版后未

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!