[ios] Reason: no suitable image found

dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /var/mobile/Containers/Bundle/Application/3FC2DC5C-A908-42C4-8508-1320E01E0D5B/Stylist.app/Stylist
  Reason: no suitable image found.  Did find:
    /private/var/mobile/Containers/Bundle/Application/3FC2DC5C-A908-42C4-8508-1320E01E0D5B/testapp.app/Frameworks/libswiftCore.dylib: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/3FC2DC5C-A908-42C4-8508-1320E01E0D5B/testapp.app/Frameworks/libswiftCore.dylib'
(lldb) 

I am getting this error when building on my iPhone. I am able to build on the simulator. I have redone all my provision files however I still can't build on my iPhone. My Xcode is like this

enter image description here

Is this a framework problem or a signing issue? This did not happen in Xcode 6. Thank you.

This question is related to ios iphone xcode dyld

The answer is


This resolved my error-

Re-downloading the WWDR (Apple Worldwide Developer Relations Certification Authority), set to Use System Default as option.


In my case ,the keychain is showing the certificate as untrusted ,to solve this problem I have set the trust options of certificate as "Always trust". Setting the certificate to "Always trust" was the main cause of the crash. I was not able to install the application into device. Solved this by setting trust option to "System defaults" instead of "Always trust" .It worked for me.


You can regenerate your certificate and restart your iPhone.

This work for me, I hope this help you.


I searched long on this issue. There are several reasons causes this issue.

If you are facing when you and Swift code/library in an Objectice C project you should try Solution 1-2-3

If you are facing this issue with a new a Swift project Solution 4 will fit you best.

Solution 1:

Restart Xcode, then computer and iPhone

Solution 2:

Go to project build settings and set Embedded Content Contains Swift Code flag to YES

Solution 3:

Go to project build settings and add @executable_path/Frameworks to Runpath Search Paths option

Solution 4:

If none of above works, this should. Apple seems to be ninja patched certificates as mentioned in AirSign's post

At InHouse certificates

Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, O=Company Name, C=FR

they added a new field named OU

Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR

so you should just recreate certificate and provision


For me this issue was appearing due to the WWRD cert -- Mine was up to date but for some reason it was set to 'always trust' instead of 'use system default', which apparently makes a difference.


I solve the problem by check my local keychains.Keep login.keychain has the right certificate


enter image description here

I have a similar issue, which detail information as the first image.

My solution is that switch the certification always trust to use system defaults. just like: enter image description here enter image description here


You need to set certificate (just certificate & not provisioning profile) for each and every dynamic framework you are linking(directly or indirectly) in your projectenter image description here


faced same issue

  1. my developer certificate was expired so created new developer certificate and download
  2. clean and restart xcode this works for me

I solved using these tricks.

Step 1:

Go to project build settings and add @executable_path/Frameworks to Runpath Search Paths option

Step 2:

Go to target build settings and add @executable_path/Frameworks to Runpath Search Paths option and Framework Search Paths.

enter image description here

Step 3:

Re-downloading the WWDR (Apple Worldwide Developer Relations Certification Authority), set to Use System Default as option.

Step 4:

Delete All derived Data using Terminal

rm -rf ~/Library/Developer/Xcode/DerivedData/*

Step 5:

Delete All Certificates and reinstalled it to Keychain. I enabled the Use System Default option.

Step 6:

Restart Xcode.


  1. Remove the app from device
  2. Clean the project (CMD + SHift + K)
  3. Build/Run on device

you probably don't have the correct arch in that lib, you can do a

file /private/var/mobile/Containers/Bundle/Application/3FC2DC5C-A908-42C4-8508-1320E01E0D5B/testapp.app/Frameworks/libswiftCore.dylib

and it should show you the arch's that are in that library... I am not sure how you are linking, but it probably isn't the right way (if libswiftcore is a factory library, if it is some add on library then it probably isn't compiled correctly)


I ran into this issue with XCode 9. Nothing of the above worked out. This did the trick for me:

Project > Build Settings > Swift Compiler - Search Path: Setting "Import Paths" to $(PROJECT_DIR) (recursive)


I had the same issue and was able to fix by re-downloading the WWDR (Apple Worldwide Developer Relations Certification Authority). Download from here:

and set to Always Trust in the keychain. Changing to Use System Default

it work for me,I hope this help you


Below steps worked out successfully.

1) In the dynamic library install name had to be "@loader_path"

2) In main project the Runpath Search Path has to be "@loader_path" and "@loader_path/Frameworks"

3) From keychain used view-->show expired certificates and removed everything.

4) Deleted the Distribution certificate and reinstalled.

5) Downloaded developer.apple.com/certificationauthority/AppleWWDRCA.cer and installed.


Xcode->Product->Clean + Xcode Restart

After attempting many of the other mentioned solutions, to my eternal embarrassment, doing an Xcode->Product->Clean and restarting Xcode, did the trick.


You see the same symptoms if you are working in Xamarin Studio and you are referencing a portable library for which you need to do the PCL bait and switch trick for. This occurs if the referencing project is out of date with respect to the referenced library. I found that I had updated my common library to a newer framework, updated my packages but hadn't updated my iOS packages to match. Updating the packages solved this error for me.


For what it's worth, I hit a similar error in XCode 9.0.1. I tried uninstalling and reinstalling all my certs, but when I reinstalled, they seemed to remember the trust setting I had previously. What ended up working for me (it seems) was turning off the 'Always Trust' setting of the "Apple Worldwide Developer Relations Certification Authority" cert followed by a reboot. What a cryptic issue!


In my case, it was an issue with one of the pods I was using. I ended up removing that pod and placing the code from it into my project manually.


I just cleaned the project and Clean Build Folder by alt Product menu


I have encountered this issue ONLY on the simulator. It seems to be related to some invalid Entitlements in our application, but the issue doesn't appear when we run on a device.


I recently faced this problem. I tried all possible solutions but nothing worked. At the end I just quit the Xcode , removed the certificates in keychain and installed everything fresh and restarted mac. Fortunately it worked like charm :)


Cited from Technical Q&A QA1886:

Swift app crashes when trying to reference Swift library libswiftCore.dylib.

Q: What can I do about the libswiftCore.dylib loading error in my device's console that happens when I try to run my Swift language app?

A: To correct this problem, you will need to sign your app using code signing certificates with the Subject Organizational Unit (OU) set to your Team ID. All Enterprise and standard iOS developer certificates that are created after iOS 8 was released have the new Team ID field in the proper place to allow Swift language apps to run.

Usually this error appears in the device's console log with a message similar to one of the following: [....] [deny-mmap] mapped file has no team identifier and is not a platform binary: /private/var/mobile/Containers/Bundle/Application/5D8FB2F7-1083-4564-94B2-0CB7DC75C9D1/YourAppNameHere.app/Frameworks/libswiftCore.dylib

Dyld Error Message:
  Library not loaded: @rpath/libswiftCore.dylib

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000120021088
Triggered by Thread: 0

Referenced from: /private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/TestApp
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x1001D8000, size=0x00194000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/Frameworks/libswiftCore.dylib
Dyld Version: 353.5

The new certificates are needed when building an archive and packaging your app. Even if you have one of the new certificates, just resigning an existing swift app archive won’t work. If it was built with a pre-iOS 8 certificate, you will need to build another archive.

Important: Please use caution if you need to revoke and setup up a new Enterprise Distribution certificate. If you are an in-house Enterprise developer you will need to be careful that you do not revoke a distribution certificate that was used to sign an app any one of your Enterprise employees is still using as any apps that were signed with that enterprise distribution certificate will stop working immediately. The above only applies to Enterprise Distribution certificates. Development certs are safe to revoke for enterprise/standard iOS developers.

As the AirSign guys state the problem roots from the missing OU attribute in the subject field of the In-House certificate.

Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR

I have an enterprise development certificate, creating a new one solved the issue.


I too had this issue, however nothing I tried above and in several other posts worked.. except for this.

For me, I changed the bundle identifier since we have a different bundle ID for distribution versus development.

My hardware is allowed on this provision and my team account is valid but it was throwing the above error on some other framework.

Turns out that I needed to completely remove the old version of the app completely from my phone. And not just deleting it the standard way.

Solution :

  1. Make sure the target phone is connected
  2. from within xcode menu click [Window>Devices]
  3. select the target device on the left side menu.
  4. On the right will be a list of applications within your device. Find the application that your trying to test and remove it.

Evidently on installing the same app under the same team under a different bundle ID, if your not starting completely from scratch, there are some references to frameworks that get muddied.

Hope this helps someone.


In my case, after I delete all certification created by Xcode and downloaded. Let xcode 8.1 manage certification of app, It works well!!! Hope this can help someone.


If you accidentally reset your keychain, this can occur due to missing Apple certificates in the keychain. I followed the answer on this to solve my problem.

I had the same issue and was able to fix by re-downloading the WWDR (Apple Worldwide Developer Relations Certification Authority). Download from here: http://developer.apple.com/certificationauthority/AppleWWDRCA.cer


It occurred on my side when building an app in the command line via xcodebuild and xcrun PackageApplication, signing the app with an enterprise profile. On our CI build servers, the certificate was set to "Always Trust" in the keychain (select certificate -> Get Info -> Trust -> "Use System Default" can be changed to "Always Trust"). I had to set it back to "Use System Default" in order to make this work. Initially we set this to "Always Trust" to work-around the keychain dialogs that appear after software updates and certificate updates.


You may still get this issue after tried @Jieyi Hu Answer. may it's seems fixed but if it's comes again (possibly on xCode 9).

However, this workaround seems to work (applies to Cocoapods 1.5.x):

  1. clean your project
  2. close Xcode and delete DerivedData
  3. open Podfile in your project , and add this:

    post_install do |installer| installer.pods_project.build_configurations.each do |config| config.build_settings.delete('CODE_SIGNING_ALLOWED') config.build_settings.delete('CODE_SIGNING_REQUIRED') end end

  4. pod update

Sources:

https://github.com/evgenyneu/Cosmos/issues/105

https://github.com/Skyscanner/SkyFloatingLabelTextField/issues/201#issuecomment-381915911

Thank you @Cédric


Removing the DerivedData did the trick for me.

Did it through Xcode -> Preferences -> Locations -> clicked the arrow behind the DerivedData path and removed the whole DerivedData folder in the Finder.


At the risk of sowing more confusion, I had this issue when updating to XC8.

None of these suggestions, nor from any other thread, solved it. What DID work, was removing EVERYTHING from the "Link Binary with Libraries" build phase, the "Target Dependencies" build phase, and the "Linked Frameworks and Libraries" General setting.

FYI, I'm using Carthage and had added $(PROJECT_DIR)/Carthage/Build/tvOS to the FRAMEWORK_SEARCH_PATHS build setting, so that my frameworks could be found.

FYI 2, this projects and the frameworks, are 100% swift and the frameworks are building DEFINES_MODULE = YES.


Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to iphone

Detect if the device is iPhone X Xcode 8 shows error that provisioning profile doesn't include signing certificate Access files in /var/mobile/Containers/Data/Application without jailbreaking iPhone Certificate has either expired or has been revoked Missing Compliance in Status when I add built for internal testing in Test Flight.How to solve? cordova run with ios error .. Error code 65 for command: xcodebuild with args: "Could not find Developer Disk Image" Reason: no suitable image found iPad Multitasking support requires these orientations How to insert new cell into UITableView in Swift

Examples related to xcode

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 iPhone is not available. Please reconnect the device Make a VStack fill the width of the screen in SwiftUI error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Xcode 10: A valid provisioning profile for this executable was not found Xcode 10, Command CodeSign failed with a nonzero exit code

Examples related to dyld

Reason: no suitable image found dyld: Library not loaded: @rpath/libswiftCore.dylib OS X Framework Library not loaded: 'Image not found' registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta Broken references in Virtualenvs dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib with anything php related dyld: Library not loaded ... Reason: Image not found