4

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.

The warning: 'ld: warning: directory not found for option "-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks\"'

The searches:

[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}]$

As usual, I've done a "clean" on both the project as well as the simulators (watch, iPhone).

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'.

rholmes
  • 4,064
  • 3
  • 25
  • 34
  • Does this app itself contain any framework targets? – matt Jul 12 '15 at 03:06
  • The only targets are and Tests, the default for a very simple, single view application (more of a tutorial/experiment than an app). – rholmes Jul 12 '15 at 03:08
  • Try deleting the tests. - By this I mean the test _target._ – matt Jul 12 '15 at 03:09
  • Thanks, Matt, that worked. Did this happen to you, too? If you put up an answer, I'll accept it ;-) Do you have any idea why this occurs? – rholmes Jul 12 '15 at 03:11
  • No more binary match in the UserInterfaceState.xcuserstate file anymore, either. – rholmes Jul 12 '15 at 03:13

3 Answers3

2

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.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • This answer http://stackoverflow.com/a/31368523/341994 says it's the Library Search Path or the Framework Search Path that's the problem. – matt Jul 12 '15 at 14:09
1

If you get this issue after upgrading Xcode, then just in Xcode click;

File -> Open Recent -> Clear Menu.

Xcode -> Quite Xcode

Go to your project directory and open your project normally.

click cmd + alt + shift + K, this will clean your project

clcik cmd + B

Then you should be fine.

Ofcourse
  • 617
  • 1
  • 7
  • 19
  • this clean my warning and add a new one - " ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks' – Roei Nadam Sep 24 '15 at 12:10
  • Roei, I had the same issue. This post solved that problem for me though. http://stackoverflow.com/a/32620919/4048853 – Derek Sep 25 '15 at 16:08
0

Change framework search path to $(PROJECT_DIR)/* for your test target