xcode 未找到 RCT 链接管理器文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31860715/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
RCT Linking Manager file not found
提问by AJcodez
I want to use react native library RCTLinkingManager
which shows up in menu under "Libraries > RCTLinkingManager.xcodeproj".
我想使用RCTLinkingManager
显示在“库> RCTLinkingManager.xcodeproj”下的菜单中的反应本机库。
However when i add it to iOS/AppDelegate.m
like so:
但是,当我将其添加为iOS/AppDelegate.m
喜欢时:
#import "RCTLinkingManager.h"
// @implementation ...
Build fails with 'RCTLinkingManager.h' file not found. I tried to clean the product and clean build with no luck.
构建失败,找不到“RCTLinkingManager.h”文件。我试图清理产品并清理构建,但没有运气。
回答by Sébastien Saunier
You have to add $(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS
to your "Header Search Paths" in the Build Config of your project. You can find more info on the official React documentation
您必须$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS
在项目的构建配置中添加到“标题搜索路径”。您可以在官方 React 文档中找到更多信息
回答by antoine129
If you are using React Native and the command line, Sébastien's modification proposal is to be made to ios/<yourproject>.xcodeproj/project.pbxproj
by adding
如果您使用的是 React Native 和命令行,则 Sébastien 的修改建议是ios/<yourproject>.xcodeproj/project.pbxproj
通过添加
"$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS",
to the HEADER_SEARCH_PATHS
lists (4 locations)
到HEADER_SEARCH_PATHS
列表(4 个位置)
回答by Florin Dumitru
I had a similar issue only when I've done the archive/release version... that happen because the import was made under the #if DEBUG
. So make sure you put the import in the proper place otherwise you can get Use of undeclared identifier 'RCTLinkingManager'error
只有当我完成存档/发布版本时,我才遇到类似的问题......这是因为导入是在#if DEBUG
. 因此,请确保将导入放在正确的位置,否则会出现Use of undeclared identifier 'RCTLinkingManager'错误