Getting dyld_fatal_error after updating to Xcode 6

2019-01-22 16:58发布

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.

标签: swift xcode6
12条回答
对你真心纯属浪费
2楼-- · 2019-01-22 17:37

Cleaning, restarting, deleting etc didn't work for me.

I have a project containing another project. When I ran the project on iOS 7 and the contained project was accessed in code, the app stopped at the line below:

enter image description here

After many days, I saw that the deployment target for the container project was 7.0 (as can be seen below).

enter image description here

The contained project on the other hand, had a deployment target of 8.1 (as can be seen below). enter image description here

Changing the deployment target of the contained project to 7.0 solved my problem!

The project was working fine on iOS 8 devices.

查看更多
ゆ 、 Hurt°
3楼-- · 2019-01-22 17:37

Clean and build won't work. You'll need to delete he cache in ~/Library/Caches/com.apple.dt.Xcode* directories. Delete these and rebuild.

Do this every time you upgrade the beta.

查看更多
贼婆χ
4楼-- · 2019-01-22 17:40

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.

查看更多
Fickle 薄情
5楼-- · 2019-01-22 17:43

I had this issue recently and the problem for me was that I had added a library from the same project which wasn't listed in 'Embedded Binaries' from the 'General' section.

NOTE: If you add it in Embedded Binaries it will also add to the Linked Libraries section, possibly adding the same one twice.

查看更多
家丑人穷心不美
6楼-- · 2019-01-22 17:46

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.
查看更多
放荡不羁爱自由
7楼-- · 2019-01-22 17:46

Adding the non-system Framework to "Embedded Binaries" inside the general tab of the main project worked for me.

As stated by bitwit, this will also add your framework to "Linked Frameworks and Libraries", so watch out for those duplicates.

Tested with Xcode 7.3.

查看更多
登录 后发表回答