gpt4 book ai didi

ios - native 模块不能为空

转载 作者:行者123 更新时间:2023-12-02 13:46:09 27 4
gpt4 key购买 nike

enter image description here

在运行适用于 iOS 的 React-Native 应用程序时,模拟器将打开并显示此屏幕。在查找问题时,发现没有人提供解决方案,请帮忙。

早些时候,我遇到了一个问题,模拟器甚至没有加载,并且构建失败并出现此错误:

以下构建命令失败:

CompileC /Users/mi0205/AwesomeProject/ios/build/Build/Intermediates/RCTWebSocket.build/Debug-iphonesimulator/RCTWebSocket.build/Objects-normal/x86_64/RCTSRWebSocket.o RCTSRWebSocket.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
/Users/mi0205/AwesomeProject/node_modules/promise/lib/done.js:10
throw err;

读了一下,我知道删除RCTWebSocket scode项目文件会导致成功构建,所以我这样做了,但此后又出现了这个问题

最佳答案

尝试使用 fetch 后我收到了同样的消息。我花了一段时间才意识到我需要将“RCTNetwork”pod 添加到我的 Podfile 中的子规范中:

target 'MyProject' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!

# Pods for MyProject
pod 'React', :path => '../my-project/node_modules/react-native', :subspecs => [
'Core',
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
# Add any other subspecs you want to use in your project
]
end

更多信息请点击:https://facebook.github.io/react-native/docs/integration-with-existing-apps.html

关于ios - native 模块不能为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38629608/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com