问题描述
我使用Xcode 7 beta 3将iOS的Swift 1.x项目转换为Swift 2.x。它编译并运行,但我有一个链接器警告持续存在。我已经通过project.pbxprox搜索了违规路径,并查看了Xcode中的构建设置但没有违规路径的迹象(甚至在图书馆搜索路径或框架搜索路径中也没有)。但是,我确实发现xcuser状态文件包含子字符串。
I converted a Swift 1.x project for iOS to Swift 2.x using Xcode 7 beta 3. It compiles and runs but I have a linker warning persisting. I've done a search through the project.pbxprox for the offending path, and have looked in the "build settings" in Xcode but no sign of the offending path (not even in the Library Search Path or the Framework Search Path). I did, however, find that the xcuser state file contains the substring.
警告:'ld:警告:找不到选项-F / Applications / Xcode-beta.app / Contents / Developer /平台/ iPhoneOS.platform / Developer / SDKs / iPhoneOS9.0.sdk / Developer / Library / Frameworks \''
搜索:
[foo@bar baz{Swift2}]$ grep -r Baz.xcodeproj/ iPhoneOS9.0
grep: iPhoneOS9.0: No such file or directory
[foo@bar baz{Swift2}]$ grep -r 'Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks' Baz.xcodeproj/
Binary file Baz.xcodeproj//project.xcworkspace/xcuserdata/bar.xcuserdatad/UserInterfaceState.xcuserstate matches
[foo@bar baz{Swift2}]$
像往常一样,我对项目和模拟器(手表,iPhone)都做了干净 。
As usual, I've done a "clean" on both the project as well as the simulators (watch, iPhone).
我检查了目录路径,看到确实没有这样的路径;路径组件存在于'iPhoneOS9.0.sdk'组件中。也就是说,此路径存在:'/ Applications / Xcode-beta.app / Contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS9.0.sdk'
但该位置没有'Developer'
子目录。但是,下面有一个框架目录,但它位于'iPhoneOS9.0.sdk / System / Library / Frameworks /'
而不是'iPhoneOS9 .0.sdk / Developer / Library / Frameworks'
。
I've examined the directory path and see that indeed there is no such path; the path components exist up to the 'iPhoneOS9.0.sdk' component. That is, this path exists: '/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk'
but there is no 'Developer'
subdirectory at that location. There is, however, a framework directory underneath, but it's at 'iPhoneOS9.0.sdk/System/Library/Frameworks/'
instead of 'iPhoneOS9.0.sdk/Developer/Library/Frameworks'
.
推荐答案
我见过这个问题。我认为这是因为某些路径错误地硬编码到测试目标的构建设置中。我不知道它是什么路径;我的回答是删除测试目标,然后错误就消失了。
I've seen this same issue. I believe that it happens because of some path incorrectly hard-coded into the test target's build settings. I don't know what path it is; my response is to delete the test target, and then the error goes away.
你总是可以制作一个新的测试目标,而你不会不必删除测试文件,因此不会有太大的损失。
You can always make a new test target, and you don't have to delete the test files, so it's no great loss.
这篇关于Xcode 7:-F /< path>的链接器警告但app.xcodeproj / project.pbxproj中的设置与< path>匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!