Dyld: library not loaded: @ rpath / libswiftContacts.dylib

dyld: library not loaded: @ rpath / libswift_stdlib_core.dylib

dyld: library not loaded: @ rpath / libswiftCore.dylib. Problem persists

I know that this question has been answered several times, but "dyld: the library is not loaded: @ rpath / libswiftContacts.dylib" I could not find the correct solution to this error when I code the Swift application for XCode 7.2:

Here I use Contact and ContactUI Frameworks :: @ rpath / libswiftContacts.dylib

dyld: Library not loaded: @rpath/libswiftContacts.dylib Referenced from: /var/mobile/Containers/Bundle/Application/C0F2B5CB-628C-4643-9473-648D3099D8FB/HomeMadeFood_User.app/HomeMadeFood_User Reason: image not found 

I tried all these steps:

  • Restart Xcode, iPhone, computer
  • Cleaning and recovery
  • Cancel and create a new certificate / security profile
  • Path search paths are $ (inherited) @ executable_path / Frameworks
  • Inline content contains Swift code: "Yes"
  • Code Signing ID is a developer
  • Removing the Xcode Derived Data Directory

    but I always got the same error ... enter image description here enter image description here enter image description here

I tried like this: but I get an error message:

 /Users/mac-jarc/Library/Developer/Xcode/DerivedData/HomeMadeFood_User-bmwdevsopruaqxfrbibhaspidobn/Build/Products/Debug- iphoneos/HomeMadeFood_User.app/Frameworks/Contacts.framework: bundle format unrecognized, invalid, or unsuitable Command /usr/bin/codesign failed with exit code 1 

enter image description here

+4
source share
5 answers

I had the same error for several weeks:

 dyld: Library not loaded: @rpath/libswiftContacts.dylib 

Essentially, I was able to run and test my application on the device. Then, about 2 weeks ago, I could no longer run tests on the device. The tests on the simulator worked fine. I can’t think what has changed. The error I saw was higher. I have been searching on Google for ages, trying to find a solution, and unsuccessfully trying to find many fixes. The fix that finally worked was to delete the derived data. Having done this, I was able to run the tests on my device again.

Fix it worked for me:

  1. Go to Xcode> "Settings"> "Locations"> "Derived data" (click on the small arrow to open the folder in Finder), for example /Users/[username]/Library/Developer/Xcode/DerivedData

  2. Delete entire DerivedData folder

  3. Clean / assembly

  4. Test on device - finally working again

+15
source

In our case, it was clear that there was a mistake in the way Xcode resolved dependencies on our goal.

Let me say that the solution was:

 import PassKit 

Now, before raising this eyebrow, this is why it worked:

  • We relied on a Swift framework that imports PassKit
  • We distributed the finished binaries to the team members.
  • The team watched the crash as the OP mentioned it
  • Adding this import to the application target forced Xcode to deploy the necessary fast libraries.

Note. Just PassKit binding in the GUI did nothing.

+1
source

Hacked it.

Check if the environment you are trying to build uses, or one of them in the dependency structure, the standard Swift library. If yes, create a NEW key in the build settings

ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;

+1
source

This error is caused by invalid Apple certification.

Go to your keychain access. In the "Keychains" section, select "System," and in the "Category" section, select "Certificates." Check if the "Apple Worldwide Public Relations Certification Authority" is valid. If you do not download this certificate from the Apple website. This will solve the problem.

0
source

I know this is an old question, but this is what helped me In short:

 EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 
0
source

All Articles