Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting dyld_fatal_error after updating to Xcode 6 beta 4 using swift

Tags:

swift

xcode6

I just recently downloaded Xcode 6 beta 4, and my swift project compiles with no errors but before it gets to my code I get a dyld_fatal_error just above start in the call stack.

call stack

and a breakpoint in some assembly code with a nop instruction

breakpoint

The console error I get is

dyld: lazy symbol binding failed: Symbol not found: __TFSsa6C_ARGVGVSs13UnsafePointerGS_VSs4Int8__   Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/Sudoku-dhrdonaeqzsgcvewndimxbbsltnc/Build/Products/Debug/Sudoku.app/Contents/MacOS/Sudoku   Expected in: /Users/username/Library/Developer/Xcode/DerivedData/Sudoku-dhrdonaeqzsgcvewndimxbbsltnc/Build/Products/Debug/Sudoku.app/Contents/MacOS/../Frameworks/libswift_stdlib_core.dylib  dyld: Symbol not found: __TFSsa6C_ARGVGVSs13UnsafePointerGS_VSs4Int8__   Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/Sudoku-dhrdonaeqzsgcvewndimxbbsltnc/Build/Products/Debug/Sudoku.app/Contents/MacOS/Sudoku   Expected in: /Users/username/Library/Developer/Xcode/DerivedData/Sudoku-dhrdonaeqzsgcvewndimxbbsltnc/Build/Products/Debug/Sudoku.app/Contents/MacOS/../Frameworks/libswift_stdlib_core.dylib 

Just so you know the project still compiles, and runs fine with Xcode 6 beta 3.

like image 590
o.uinn Avatar asked Jul 22 '14 03:07

o.uinn


2 Answers

Most extremely weird problems like this can be solved with a Clean & Build (or perhaps relaunch Xcode). You might also consider deleting the relevant folders from ~/Library/Developer/Xcode/DerivedData.

like image 163
jtbandes Avatar answered Sep 22 '22 15:09

jtbandes


For sure this error is very unhelpful:

dyld`dyld_fatal_error: ->  0x1200ad088 <+0>: brk    #0x3 

This of course occurs only on device, not the simulator. Another good reason to always test on a device.

Anyway, having had the same issue, a clean didn't work for me. Deleting DerivedData didn't help either. Also tried synchronising the Deployment Target versions. That didn't seem make any difference but I did it anyway.

Solution was to add any dynamic frameworks to Embedded Binaries setting under Target -> General:

setting an embedded binary

Now I know that has been mentioned in other answers. However, if I can supplement by saying that any dependent dynamic frameworks must also be included.

So for example if you have a dynamic framework A that depends upon dynamic framework B, then it's necessary to have A and B added to Embedded Binaries.

Note that if the dynamic framework A depends upon any static library or framework, you will almost certainly be forced to create A as an umbrella framework that includes the dependant binaries.

Other considerations that may or may not be important. However did personally for me result in success were;

  • paths of each dynamic library in the Inspector were set to "Relative to Group". In the screen grab above the path of the embedded binary appears correct terminating with "build/Debug-iphoneos".

  • dynamic frameworks are in embedded binaries section. Static libs and static libs wrapped up as frameworks are in Linked Frameworks and Libraries. Nothing appears in both sections.

In setting this up XCode behaved strangely. The following proved successful:

  1. Add the dynamic framework to the embedded binaries.
  2. Find the new framework in XCode groups on the left and update the path to be "Relative to Group" as described previously.
  3. Delete the dynamic framework from embedded binaries.
  4. Add the dynamic framework to the embedded binaries again. The path should now appear correctly.
  5. Delete all references to the dynamic framework from the Linked Frameworks and Libraries section.
like image 22
Max MacLeod Avatar answered Sep 26 '22 15:09

Max MacLeod