【发布时间】:2017-09-27 16:35:39
【问题描述】:
我在 Xcode 中的 React Native 项目中收到此构建警告
warning: the transform cache was reset.
希望有人能帮我摆脱它!
提前致谢。
【问题讨论】:
标签: ios xcode react-native
我在 Xcode 中的 React Native 项目中收到此构建警告
warning: the transform cache was reset.
希望有人能帮我摆脱它!
提前致谢。
【问题讨论】:
标签: ios xcode react-native
在运行位于 node_modules/react-native/scripts/react-native-xcode.sh 的 react native 捆绑脚本时,我收到了类似的警告。 我不得不删除这一行
--reset-cache \
摆脱错误。
【讨论】:
好吧,我参加这个聚会迟到了,但不妨为发生在我身上的事情做出贡献。过去几天我一直遇到这个问题,消息the transform cache was reset 并不是真正的问题。毕竟这是一个警告。就我而言,真正的问题是该节点内存不足。有一种快速修补它的方法,但很有可能您必须减少软件包。
补丁继续Build Phases > Bundle React Native code and images
改变
export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh
到
export NODE_BINARY=node
export NODE_OPTIONS="--max_old_space_size=4096"
../node_modules/react-native/scripts/react-native-xcode.sh
同样,这只是一个补丁,所以如果您遇到此问题,可能是节点内存不足的原因。
【讨论】:
运行$ npx react-native start --reset-cache 删除警告。然后启动您的应用程序
$ npx react-native run-ios --variant=release
【讨论】:
在运行脚本构建阶段调用 React Native 捆绑脚本,如下所示:
../../node_modules/react-native/scripts/react-native-xcode.sh | sed 's/warning: //'
这将从输出中删除单词“警告:”。
【讨论】: