Xcode Simulator - CyMemDef.dylib: mach-o, but not built for iOS simulator

Viewed 4778

I am working on a new Macbook and just downloaded and installed Xcode with developer tools.

I have create a brand new project in Xcode (no modification or adding framework / pods). I am trying to run the same on simulator. When I do, my app crashes with "SIGABRT". The log shows the following message:

dyld: Library not loaded: /Library/Application Support/Cylance/Desktop/CyMemDef.dylib
Referenced from: /Users/me/Library/Developer/CoreSimulator/Devices/80FC5E5D-2979-48C9-94F6-6C6D2A8073E6/data/Containers/Bundle/Application/B438FB0C-79A7-445E-B381-5D7E9247623B/demo.app/demo
Reason: no suitable image found.  Did find:
/Library/Application Support/Cylance/Desktop/CyMemDef.dylib: mach-o, but not built for iOS simulator
3 Answers

The solution for me was to change my project's iOS Deployment Target to 11.4 or earlier.

With iOS Deployment Target 12.0, the app crashes every time!

I am running Xcode 10.0 and Cylance 2.0.1500.518 on macOS High Sierra 10.13.6.

Had similar trouble with CryptoKit, which was available only in iOS 13 and higher (while project was targeted iOS 9.3). It appeared that CryptoKit was not marked as weak for some reason. Adding -weak_framework CryptoKit into target's Build Settings > Other Linker Flags solved the problem for me:

enter image description here

Another cause for the same error.

Having a misconfigured custom modulemap file can also be the cause of this issue.

In my case, this was the error:

--- framework module XXYZ {
+++ module XXYZ {
    header "SomethingCustom-header.h"
}
Related