ios - react native - 在构建发布时将 --max_old_space_size 添加到 iOS 项目

标签 ios node.js react-native

我可以在 Android 中添加 --max_old_space_size 以在 React Native 中进行发布构建。但是,我无法将其添加到 iOS 构建版本中。我找到了答案,但它不起作用。

React Native build fails with "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory"

这里有一些有用的链接:

React Native ios build : Can't find node

如果您有任何建议,请告诉我。我很乐意听取你们的意见。

提前谢谢您!

最佳答案

答案在此链接中:

Javascript out of memory heap

更改:

shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";

致:

shellScript = "export NODE_BINARY='node --max_old_space_size=8192'\n../node_modules/react-native/scripts/react-native-xcode.sh";

在:

ios/YourProjectName.xcodeproj/project.pbxproj

请耐心等待,因为该项目在构建发布时花费了大量时间。超过10分钟。

关于ios - react native - 在构建发布时将 --max_old_space_size 添加到 iOS 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53630185/

相关文章:

ios - SwiftUI:基于环境初始化ObservableObject

iphone - Core Data - 如何生成 CoreDataGeneratedAccessors?

html - 无法找到错误 "Warning: Task "uglify“未找到”的解决方案

React-Native 导航 v5 : How to change a tabBarLabel or tabBarIcon and the colorBackground of the tab on a specific screen?

javascript - 在 React Native 中根据条件渲染元素

ios - 为自定义类设置委托(delegate)对象

ios - 如何将拍摄的照片放到主线程?

javascript - 停止或终止 Node 媒体服务器

node.js - 以下代码中的 db.createCollection 是否总是会设置一个新数据库?

ios - React-Native-Image 不播放完整的 gif