2

So I have an xcode project that fails every time I run it on my computer. Works on other computers though. I get the following error:

dyld: Library not loaded: /System/Library/PrivateFrameworks/Swift/libswiftCoreFoundation.dylib

Now, when I look in /System/Library/PrivateFrameworks/Swift/ I can't find the libswiftCoreFoundation.dylib file. But other swift projects work just fine. I have no idea how to fix this. I've tried cleaning, restarting my computer, creating a copy of the project, updating Xcode, updating command line tools, everything I could think of.

The project was working just fine a few hours ago. Something went wrong by itself. No clue how to fix things.

JoeVictor
  • 1,806
  • 1
  • 17
  • 38

1 Answers1

3

After spending 6 straight hours debugging and trying to fix things, I found the solution. For some reason, my "Library Search Paths" was filled with the wrong directory. I never set it to that directory. But it was set.

Here is what I mean:

LSP

The highlighted field was filled with the following: macosx/System/Library/PrivateFrameworks/Swift

I just took that out. I hope this helps save some future traveler the pain and torture I went through

JoeVictor
  • 1,806
  • 1
  • 17
  • 38
  • 1
    Thank you!! This saved me potentially a ton of digging around. Just to add another data point, I also was getting this under Xcode 9.2. My project was working fine for several days of development, then suddenly started crashing with this error—like you, I decidedly never changed the Library Search Paths, but it seems something triggered Xcode to change it for me. I'll file a radar. – Siobhán Jan 28 '18 at 18:00
  • This makes me really happy! This is literally the worst bug I have ever faced in my life. Glad I could spare someone from having to deal with the same. – JoeVictor Jan 28 '18 at 18:24