112

When I start my app with Xcode, I have a crash, but without an error.

The app is just stopping on this thread:

Enter image description here

What can I do to have more information about the issue?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Kevin ABRIOUX
  • 16,507
  • 12
  • 93
  • 99

32 Answers32

116

If you are using custom frameworks, you need to put it inside the "Embedded Binaries" section located in the Xcode project under the tab Target / General.

mkonovalov
  • 1,261
  • 1
  • 7
  • 5
  • 1
    I do have a custom framework and it is listed under "Embedded Binaries" in the Xcode Project under Target > General. I am still getting this problem when I try to run my unit tests. I recently upgraded the Swift portions of my code to Swift 3 (from 2). If that helps... – Mario A Guzman Mar 17 '17 at 03:28
  • @MarioAGuzman How did you fix it? I also face the issue after Swift 3 migration – iOS Mar 24 '17 at 07:09
  • @iOS Unfortunately I had no real fix. The issue resolved itself with Xcode 8.3 that was just released. – Mario A Guzman Mar 29 '17 at 20:02
  • Why does this need to be in Embedded Binaries section? I'm trying to use the ObjectiveDropboxOfficial.framework. I was getting this error, put it into Embedded and it 'fixed' it. However, I took it out again, and it remains 'fixed'. Other targets that are configured the same AFAICT it fail though. The dropbox install docs do not say to put in Embedded Frameworks. – Jim Leask May 02 '17 at 23:04
  • That helped. Also make sure that you don't have duplicates in the "Linked Frameworks and Libraries". When you add it to the Embedded section, it automatically adds it to the Linked section. – milesmeow Apr 12 '19 at 17:55
67

For me a simple Clean and Rebuild sorted it out.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
FlixMa
  • 944
  • 1
  • 7
  • 20
32

This problem appeared after a system update up to macOS 10.15.2 beta (Catalina). Disabling "Thread Sanitizer" solved the issue (Xcode 11.2). Now I can't use Thread Sanitizer and have to wait for the next OS update.

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • 6
    This post answers to the original questions when the problem arises in the Xcode 11.3 simulators after upgrading to Mac 10.15.2 . It seems the Apple bug, see https://forums.developer.apple.com/thread/126891 – Vadim Motorine Dec 21 '19 at 05:42
  • [Xcode 13.1 on macOS 12.0.1] Still causes the Abort when "Thread Sanitizer" is on; however, Simulator running iOS 15 seems to be OK even with the option on. – WPK Oct 29 '21 at 21:13
20

Adding the framework to the embedded binary asset list fixed this. Here is what the setup of a foreign framework looks like in final form in the Xcode GUI as an Embedded Framework (Xcode 9.2, personally I like a visual breadcrumb trail better ;-) ):

Enter image description here

Did Apple intentionally crash the runtime to somehow tell the developer about the problem that you cannot use non-Apple frameworks as simply linked frameworks in iOS development? It would be better to have it come up as a build error I would think... with a button that said "move it!"

The use of Embedded Binaries keeps the end user from having to add the Framework independently of your app (or have you do with an installer). In the case of the iPhone (iOS), that is impossible, but on macOS, it is possible, but it can get messy fast.

For the end user, it is much nicer to simply drag and drop an app to install it on macOS, which is where embedded becomes a benefit. Embedding also avoids the classic "DLL conflicts" of having external versions of your framework to manage. (Disk space is cheap, but my customer's time is precious.)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Cerniuk
  • 14,220
  • 2
  • 29
  • 27
  • Small update. Xcode 10.1 now allows you to now drag the custom framework from the "Link Binary With Libraries" section, where it goes by default, to the "Copy Bundle Resources" section where it needs to be... It no longer just copies the reference but moves it as well. Screen shot here: https://stackoverflow.com/questions/24993752/os-x-framework-library-not-loaded-image-not-found/55196527#55196527 – Cerniuk Mar 16 '19 at 12:09
17

To answer the original question "What can I do to have more informations about the issue?", this Apple forum thread provides a very simple tip: simply run your crashing app outside Xcode (i.e., stop it from Xcode, then run it manually on your device).

This will produce a crash log containing more details about what happened. You can then review this log from the Xcode Window menu → Devices and SimulatorsView Device Logs.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
fred
  • 321
  • 2
  • 6
  • 7
    This is why you scroll past the top answers. Checking the device logs got me moving in the right direction. Thank you for your answer! – Mike Richards Dec 15 '21 at 20:31
15

I fixed the error in my project just now!

If you are using the Swift framework in an Objective-C project, I advice you to change the build settings.

Set the Always Set Embed the Swift Standard Libraries option to Yes. Like this:

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Hongbo Liu
  • 158
  • 1
  • 5
  • This worked for me even if there is (apparently) no swift code in my project. – Jim75 Feb 17 '20 at 14:13
  • XCode changed to value back to No and I had forgotten about it. Thanks :) – SeikoTheWiz May 15 '20 at 08:12
  • This wasn't needed in iOS 15, but was needed for iOS 11.4 when testing with a simulator in Xcode 13.4 where the app used an xcFramwork with some swift code. Always test old iOS versions if you claim to support them! – ScottyB Oct 31 '21 at 19:58
15

It was finally solved!

Making the framework "optional" instead of "required" worked for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Eran Talmor
  • 1,918
  • 1
  • 12
  • 6
  • super man, i fought with this problem 1,5 days. even found this nice matrix https://twitter.com/isupportmatrix changing it to required solved at my side too – swift2geek Jan 30 '19 at 09:02
  • and also it worked for only with setting in File -> Project Settings-> Legacy build system – swift2geek Jan 30 '19 at 10:05
11

In Xcode 11.1, turn off Do not Embed in Embed & Sign is a nice option.

0

222

Credit: mkonovalov's answer and William Cerniuk's answer

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
black_pearl
  • 2,549
  • 1
  • 23
  • 36
7

Unchecking "Guard Malloc" in diagnostics worked for me.

See the image for settings

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
infiniteLoop
  • 2,135
  • 1
  • 25
  • 29
  • 2
    `Guard Malloc`, to be correct. Anyone know why it fixes the crash? – Mojo66 Apr 01 '18 at 11:20
  • 1
    You can also try Cleaning the project and then run again or just restart Xcode. These kind of errors are just annoying and are kind of like bugs in Xcode – Karanveer Singh Nov 05 '18 at 07:27
6
  1. Continue the execution to see if any message shows up in debugger such as "MyFramework.framework" not found. If that is the case, follow this question: OS X Framework Library not loaded: 'Image not found' For me Amos Joshua's answer worked.

  2. Make sure you have added your binaries through "Embed Binaries" section.

  3. Make sure you have enabled signing of frameworks in build phase section.

  4. Make sure the embedded frameworks are not symlinks.

  5. You can make the linked frameworks optional instead of required in "Link binary with libraries" phase. This will tell iOS to not look for these frameworks during launch. But anyway you need to fix the errors to use those frameworks!

  6. Check if all the info.plist entries are good. In my case, I was using a Mac info.plist file for iOS. It was looking for some xib file which was not present in the iOS project.

  7. Do a clean and build after any such change. This is required because Xcode does not copy/change these files if they already exist.

  8. Remove the app from iPad and then install. Same reason as 7.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
coolVick
  • 538
  • 3
  • 7
4

I had just missed applying the "Privacy - Camera Usage Description" in the info.plist file.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Linus
  • 423
  • 5
  • 12
  • This seems to be a repeat of [WangYang's answer](https://stackoverflow.com/questions/42027601/dyld-abort-with-payload-without-an-error-message/47407866#47407866). – Peter Mortensen Apr 21 '22 at 14:29
4

I faced the same issue with Xcode 11.3 and macOS v10.15.2 (Catalina) . The app was running well on the device, but not in the simulator. It seems there is an issue with the simulator and the workaround is to disable Thread Sanitizer.

Refer to Xcode 11.3 simulator SIGABRT on launch.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Pankaj Kulkarni
  • 553
  • 4
  • 12
3

I encountered an error with the same signature (my project was in Objective-C) and discovered I had forgotten to link with the appropriate framework. The error message in the debug log that led to finding the error was:

dyld: Symbol not found: OBJC_CLASS$_SFSafariViewController

For my specific error, adding SafariServices.framework in the TargetsBuild Phases"Link Binary With Libraries" resolved the issue. While you probably don't have the same specific error and resolution, checking the debug log for clues is useful.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
3

Sometimes it happens when you use system frameworks that are accessible only from a later iOS version than your target version. It might be fixed by marking this linked framework as optional.

For example, a project targeted on iOS 11 and being using AuthenticationServices for the iOS 12 AutoFill feature will crash on iOS 11 in the described way.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
lazarevzubov
  • 1,767
  • 2
  • 14
  • 24
3

I had a similar issue that was resolved by a missing permission specification in plist (as weird as it is...).

I've tried to use AVCaptureDevice and it just crashed at starting (my app was very minimal).

Adding Privacy - Camera Usage Description to the info.plist file solved it for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rock_Artist
  • 555
  • 8
  • 14
  • If your app attempts to use or request permission for a feature (camera, contacts, location, etc) but the info.plist does not provide a usage description, this very unhelpful crash may occur. – levous Jan 09 '22 at 04:34
  • This seems to be a repeat of [WangYang's answer](https://stackoverflow.com/questions/42027601/dyld-abort-with-payload-without-an-error-message/47407866#47407866). – Peter Mortensen Apr 21 '22 at 14:30
2

If you're using a framework written in Swift in an Objective-C application, you need to include the Swift toolchain in the app that consumes the framework.

The way I've found to do this is to create a dummy Swift file in the app, so that Xcode recognizes Swift and appropriately adds it to the project. You can then delete the dummy file.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
markw
  • 321
  • 1
  • 3
  • 14
2

I've had this situation after updating Xcode to v10.2.1 and Swift to v5.0.

If you are using Carthage + RxSwift, the new RxSwift uses RxRelay.framework. You should go to your /Carthage/Build directory find that framework and drag it to your project. Don't forget also add it to your carthage copy-frameworks script: $(SRCROOT)/Carthage/Build/iOS/RxRelay.framework

It was resolved thanks to fred's answer.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
milczi
  • 7,064
  • 2
  • 27
  • 22
2

I had this issue and didn't have success with the answers. I was using a custom framework that would connect with Bluetooth devices. So the crash was happening because I had missed applying the "Privacy - Bluetooth Always Usage Description" in the info.plist file.

Check all your permissions fields are set up in the p-list file.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
CoderDam
  • 65
  • 6
1

If you use the Carthage build framework, after dragging the framework to your project, you should add it to General/Embedded Binaries.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
responser
  • 432
  • 4
  • 7
  • Can you add a reference to the Carthage you speak of? It probably not about pork farming or [the Romans](https://en.wikipedia.org/wiki/Third_Punic_War). – Peter Mortensen Apr 21 '22 at 14:08
1

I found the right way to resolve it.

Make sure the AppleWWDRCA.cer is set to the system default mode, and then it will work:

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Leo
  • 11
  • 1
1

I was facing the same issue. Setting 'Always Embed Swift Standard Libraries' to Yes in Build Settings of my target worked for me.

  • This is a repeat of [Hongbo Liu's answer](https://stackoverflow.com/questions/42027601/dyld-abort-with-payload-without-an-error-message/44301596#44301596). – Peter Mortensen Apr 21 '22 at 14:25
1

Also if you are using custom frameworks, make sure you set the Mach-O type to static library. I read somewhere that iOS doesn't allow dylib. Anyway, this worked for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Michael Ribbons
  • 1,753
  • 1
  • 16
  • 26
  • Re *"set the Mach-O type"*: Where? In Xcode? In some configuration file? Please respond by [editing (changing) your answer](https://stackoverflow.com/posts/61072631/edit), not here in comments (***without*** "Edit:", "Update:", or similar - the answer should appear as if it was written today). – Peter Mortensen Apr 21 '22 at 14:54
1

To add to the long list of encounters with this error, it occurs when I am on Xcode 12.2 Beta 2 deploying to my Mac running macOS v10.15.5 (Catalina) with the deployment target set to macOS v11.0 (Big Sur).

This situation happened because I was trying out the Mac Catalyst Tutorial app on adding a SideBar. Switching the target to macOS v10.15.5 eliminated the error and launched the app properly.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Steve Harris
  • 206
  • 2
  • 6
1

I faced this issue on iOS 14.5 when playing/implementing ATT (App Tracking Transparency) and have yet to add a usage description in file info.plist on why user tracking is needed.

The app crashes whenever the settings "Allow Apps to Request to Track" was enabled (when disabled, everything worked well).

The crash in Xcode provided no clues, except

libsystem_kernel.dylib`__abort_with_payload: (SIGABRT)
CoreSimulator 757.5 - Device: iPhone 11 (29AD27B2-6EC0-4B9C-8C8C-C5450695A19C) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 11

Using the answer from fred's answer and getting the crash log from the actual device yielded this clue which was extremely helpful.

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: TCC, This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSUserTrackingUsageDescription key with a string value explaining to the user how the app uses this data.
Triggered by Thread:  1
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
app4g
  • 670
  • 4
  • 24
0

I have fixed my error in my project.

  1. I checked the other threads when the error happened. I found my error is about the camera.

    Enter image description here

  2. Add the Camera privacy in the Info.plist file.

    1. Open the info.plist file.

    2. Add a new key called "Privacy - Camera Usage Description" and enter a string that describes why the app need camera. The describes will display when your app need to use the privacy.

      Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
WangYang
  • 1
  • 2
0

I've just had the same issue and the reason why was due to the fact that I've revoked my Developer Certificates and created new ones with Xcode 10, after a fresh macOS v10.14 (Mojave) update (for some reason, it deleted all login credentials and outdated some keychain certificates).

So, all I had to do was to remove the installed apps from my device and run them through Xcode again, in order for it to install the right new Provisioning Profile in my device :)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Frank Eno
  • 2,581
  • 2
  • 31
  • 54
0

Actually, I had the issue with Xcode 11.3.1 and Thread Sanitizer was already turned off as mentioned in previous answers.

In my case, the issue was I used to have different Xcode versions in my Application folder like this:

/Applications/xcode11.3.1/Xcode.app
/Applications/xcode11.3/Xcode.app
/Applications/xcode10.1/Xcode.app

and

/Applications/Xcode.app - was 11.2

The build system looks on the /Applications/Xcode.app file by default. So bringing Xcode 11.3.1 to the /Applications/Xcode.app finally resolve the problem.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
d.rozumeenko
  • 126
  • 2
  • 3
  • What do you mean by "bringing"? Editing the Xcode.app file and adding (or changing) version information to it? Or something else? – Peter Mortensen Apr 21 '22 at 14:53
0

The same issue happened with me. I had iOS 14 Beta and the problem was fixed when I updated it to the official version.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Dakata
  • 1,227
  • 2
  • 14
  • 33
0

I fixed it by changing "Embed & Sign" to "Embed without Signing" under General > Frameworks, Libraries and Embedded Content.

chocolate cake
  • 2,129
  • 5
  • 26
  • 48
0

I didn't think this applied to me because I wasn't using the camera, but it did.

Many answers reference adding a Usage Description to Info.plist. I didn't know there are many more cases where a usage description is necessary (besides just the camera), see this link.

The link lists these services as needing a usage description or will cause this error:

Calendar, Contact, Reminder, Photo, Bluetooth Sharing, Microphone, Camera, Location, Heath, HomeKit, Media Library, Motion, CallKit, Speech Recognition, SiriKit, and TV Provider.

Add an entry to Info.plist, start typing "Privacy" as the key, and you will see all the available options pop up.

Minimistro
  • 73
  • 7
-1

I experienced that problem only when running on a real device (iPhone SE). In a simulator project it worked as expected.

I did try all fixes from this very question and from OS X Framework Library not loaded: 'Image not found'

None of those worked for me.

For me problem was solved after restarting the iPhone (sic!).

I did:

  • clean build folder,
  • clean derived data,
  • delete app from device,
  • reboot device

And it finally works. :)

If every other solution fails, don't forget to try it out.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
vandermesis
  • 63
  • 1
  • 8
-3

I got it sorted by the "pod install" command.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Amandeep Singh
  • 746
  • 5
  • 4