Unable to Run Application on Device “dyld: Library not loaded”

Hi ,

Since the release of the Xcode 8 i was unable to run my application on my device , I can run it only on simulator .. and this the same for all my project ( Objective - C / Swift )

Some of my project runs with cocoapods and some without .. but also not running on Devices .

I’m using Both Xcode 7 & Xcode 8 ( Xcode 7 for my old projects running on Objective-C ) , even Xcode project stopped working on devices .

I tried every thing .

  • Deleted All Xcode Verisons
  • Deleted cocoapods
  • Cleared Cache
  • Cleared DerivedData
  • Restarted my laptop
  • Installed a fresh version of Xcode 8.1 from the app store
  • Installed Cocoapods after deleting every thing released to it
  • Delete /Library/Preferences/com.apple.dt.Xcode.plist
  • Delete ~/Library/Preferences/com.apple.dt.Xcode.plist
  • Delete ~/Library/Caches/com.apple.dt.Xcode
  • Delete ~/Library/Application Support/Xcode
  • Reinstalling the WWDR Certificate
  • Verified that the path has: @executable_path/Frameworks
  • Test with Bitcode: YES and NO
  • Put in "Always Trust" mode the apple certs.
  • opened my project and run on device still getting the following error :


dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /var/containers/Bundle/Application/538AEF81-2E5D-4BCD-A31E-E1AAA4D2ABE6/XXXX.app/XXXX
  Reason: no suitable image found.  Did find:
  /private/var/containers/Bundle/Application/538AEF81-2E5D-4BCD-A31E-E1AAA4D2ABE6/XXXX.app/Frameworks/libswiftCore.dylib: code signing blocked mmap() of '/private/var/containers/Bundle/Application/538AEF81-2E5D-4BCD-A31E-E1AAA4D2ABE6/XXXX.app/Frameworks/libswiftCore.dylib'

Please help me fix this

Thanks!

Faisal Sabri

Accepted Reply

At least i solved it!, I deleted all the apple certs and keys from my keychain, deleted my account to xcode and closed it, restarted my computer, I deleted all the certs and provisioning from Member Center -> certs and provisioning profiles, created again the cert and provisioning profile, opened XCode add my account again, downlod the new provisioning and now I can run again the project in my device.

Replies

At least i solved it!, I deleted all the apple certs and keys from my keychain, deleted my account to xcode and closed it, restarted my computer, I deleted all the certs and provisioning from Member Center -> certs and provisioning profiles, created again the cert and provisioning profile, opened XCode add my account again, downlod the new provisioning and now I can run again the project in my device.

It doesn't work for me.
It's horrible issue. I spent a week on it. I think I should reinstall mac os.

It doesn't work for me.

I spent a week on it. Evan i updated xcode to latest version and updated OS aswell but no luck.

Kindly sugest me to solve this

Hi lebdeac,

I solved this issue after breaking my head for four days.Problem was i am making trust certificate to
"always trust" but we should not do that .it should be system default.it was working when i made to "Use system default"

1.delete all certificates from keychain.

2.Quit xcode

3.Delete xcode derivedData and delete all provison profiles

4.Restart mechine

5.Downlaod latest certifcates and provison profile from Member Center

6.Click on certifcate i will install in keychain access.your key chain access should like this


7.clean xcode and run build .you will able to run now

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!

doesn't work for me too

Thanks Savior!

It works perfectly for me : all cleaning very attentive. One reboot. Revokation and recreation of certificat. Now running. Thanks !!!

Helped me too! Changed to "Use System Default", reboot, clean, build - everything works! Thanks a lot!

I had the same problem:

dyld: Library not loaded: @rpath/libclang_rt.asan_ios_dynamic.dylib

Referenced from: /private/var/containers/Bundle/Application/.../Frameworks/....framework/...

Reason: image not found

This is my own app with my own (build for debug) framework.

What solved it for me is to make sure the Diagnostics ticked in the Run scheme are the same for the app and for the framework.

This was not needed with Xcode 9.2...

This solved my "unable to build chain to self-signed root for signer" error from productsign. Setting the trust setting back to system default from "always trust" eliminated the error.