找不到 Xcode 10 词法或预处理器问题 .h 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/51311653/
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
Xcode 10 Lexical or preprocessor issue .h file not found
提问by HawkEye1194
When using the new Xcode 10 build system under File -> Workspace Settings -> New Build System (Default) my app will not compile because it cannot find a .h file for an embedded .framework that I am using in my project. Once I set the build system to use the legacy build system the project builds perfectly fine. How can I use the new build system and fix this issue where it cannot find the .framework .h file? The project builds perfectly fine in Xcode 9.4.1 without issues or when using the legacy build system on Xcode 10.
在 File -> Workspace Settings -> New Build System (Default) 下使用新的 Xcode 10 构建系统时,我的应用程序将无法编译,因为它找不到我在项目中使用的嵌入式 .framework 的 .h 文件。一旦我将构建系统设置为使用旧版构建系统,项目就会完美地构建。如何使用新的构建系统并修复找不到 .framework .h 文件的问题?该项目在 Xcode 9.4.1 中构建得非常好,没有问题,或者在 Xcode 10 上使用旧构建系统时。
回答by HawkEye1194
I ended up fixing this issue. What I ended up doing was going to target -> Build settings and changing the Framework search path to an absolute path.
我最终解决了这个问题。我最终要做的是定位 -> 构建设置并将框架搜索路径更改为绝对路径。
Before my change it was ~/Documents/FrameworkRootFolder now it is /Users/$(USER)/Documents/FrameworkRootFolder and I set it to recursive. Seems to build fine now.
在我更改之前它是 ~/Documents/FrameworkRootFolder 现在它是 /Users/$(USER)/Documents/FrameworkRootFolder 并且我将它设置为递归。现在似乎建造得很好。
I also had another issue with multiple apps produce .app error and fixed it with this: In case someone is still struggling with this after updating cocoapods and reinstalling pods:
我还遇到了多个应用程序产生 .app 错误的另一个问题,并用这个修复了它:万一有人在更新 cocoapods 并重新安装 pods 后仍然在努力解决这个问题:
Open Build Phases of the target which gives you problems Open Copy Pods Resources phase. Make sure the Output Files is empty. In my case I had a strange entry ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}. I removed it and the build was successful
打开目标的构建阶段,这会给您带来问题 打开复制 Pod 资源阶段。确保输出文件为空。就我而言,我有一个奇怪的条目 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}。我删除了它并且构建成功
Xcode 10 Error: Multiple commands produce for 'app' and 'appex'