找不到 -IRCTNetwork 的 xcode 库 [英] xcode librarby not found for -IRCTNetwork
问题描述
我已经尝试使用 xcode 运行本机项目.当我运行时,它显示了错误
I have react native project that I'm trying to run with xcode. when i run it shows me the error
ld: library not found for -lRCTNetwork
clang: error: linker command failed with exit code 1 (use -v to see invocation)
实际上,我不知道什么是-RCTNetwork,这不是我安装的任何插件.
actually, i don't know what is -RCTNetwork, it's not any plugin I installed.
推荐答案
发生此错误的原因是您尚未在 Xcode 中将网络库添加或链接到您的构建阶段.
This error occurs because you haven't added or linked the network library to your Build Phases in Xcode.
从 node_modules/react-native/Libraries/Network/
拖动文件 RCTNetwork.xcodeproj到 Xcode 中的库文件.
Drag the file, RCTNetwork.xcodeproj from node_modules/react-native/Libraries/Network/
to the libraries file in Xcode.
然后点击 Xcode 右上角的Build Phases.
Then click on Build Phases on the top right-hand corner in Xcode.
点击Link Binary With Libraries下拉菜单,然后点击+号添加libRCTNetwork.a
Click the drop down of Link Binary With Libraries, then the + sign to add the libRCTNetwork.a
运行构建并重新启动模拟器或设备.
Run the build and restart your emulator or device.
这篇关于找不到 -IRCTNetwork 的 xcode 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!