Getting dyld_fatal_error after updating to Xcode 6 beta 4 using swift

后端 未结 12 1978
伪装坚强ぢ
伪装坚强ぢ 2020-12-14 14:30

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 s

相关标签:
12条回答
  • 2020-12-14 15:10

    You'll get this if your scheme has "Guard Edges" enabled in diagnostics when running on an actual device. "Guard Edges" only works in the simulator.

    0 讨论(0)
  • 2020-12-14 15:17

    This problem still occurs in Xcode 7, and it can happen for a variety of reasons (it seems). In my case, the iOS app with an included framework:

    1. ran on the simulator fine
    2. gave the error you described on the device

    The answer was to NOT use linked libraries but rather Embedded Binaries under General.

    Also see here: https://stackoverflow.com/a/34052368/8047

    0 讨论(0)
  • 2020-12-14 15:18

    I was using cocoapods and had this problem as well when I updated to deploy target iOS 8 and added use_frameworks! to my Podfile. I was able to fix it by adding the following line to my Podfile:

    link_with 'TargetName1', 'TargetName2', etc.

    Might work with ProjectName as well

    0 讨论(0)
  • 2020-12-14 15:19

    I have just had this problem trying to link a custom iOS framework to my project, so for anyone out there who has this problem, it's to do with the copy files build phase.

    I think that this error results when a file cannot be found. So create a copy files build phase in the appropriate target in your project. Then add the file (in my case the custom framework) to this phase (if it's a framework make sure to select the 'Frameworks' destination).

    0 讨论(0)
  • 2020-12-14 15:20

    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:

    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.
    0 讨论(0)
  • 2020-12-14 15:22

    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.

    0 讨论(0)
提交回复
热议问题