dyld: Library not loaded: @rpath/libswiftCore.dyli

2020-03-04 07:42发布

问题:

I am getting this issue in my existing project and i tried to create new project then i run in device getting same issue

    dyld: Library not loaded: @rpath/libswiftCore.dylib
      Referenced from: /var/mobile/Containers/Bundle/Application/D14EA274-0C2B-457B-8E8F-494197978F34/Pro.app/Pro
Reason: no suitable image found.  Did find:
    /private/var/mobile/Containers/Bundle/Application/D14EA274-0C2B-457B-8E8F-494197978F34/Pro.app/Frameworks/libswiftCore.dylib: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/D14EA274-0C2B-457B-8E8F-494197978F34/Pro.app/Frameworks/libswiftCore.dylib'

some of the answer i tired but still getting same issue

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

回答1:

I found this issue some months back. It was cause by Apple's default certificate being expired.

This resolved my issue.

  1. Go to keychain access
  2. Select "System" in "Kechains" and "All Items" in "Category"
  3. There will be a certificate with name "Apple Worldwide Developer Relations Certification Authority". Check if it's valid
  4. In my case, it had been expired. Delete that certificate if it's expired or is showing as signed by unauthorized identifier
  5. Goto https://www.apple.com/certificateauthority/ and download "Worldwide Developer Relations - G2 Certificate" under "Apple Intermediate Certificates"
  6. Install the certicate
  7. Clean, Build and run.


回答2:

In Xcode, you can go to Window -> Projects, and find your project name and delete "Derived Data". This should resolve your issue.



回答3:

My solution is as below:

  1. go to "TARGET" > "Build Settings";
  2. search for "Runpath Search Paths", check if value contains "$(inherited)" & "@executable_path/Frameworks", add them if doesn't;
  3. clean and rebuild project.

That's all.



回答4:

I deleted the "Derivered Data" and that fixed the issue.

For people who have xcode 8.3 the path is :

in "File" or in "Workspace Settings" --> "Project Settings" --> click the gray arrow under the "Derived Data" --> Select your project folder and delete it.

Hope this helps!



回答5:

For me Following steps helped me:

1.Delete your app from device

2.From "TARGET">"Build Settings">"Runpath Search Paths" ^ then check for values "$(inherited)" & "@executable_path/Frameworks", Feel free to add incase they dont exist

  1. Build your app and run it on device


回答6:

Now (2017 June) at Xcode 8.3.2, Swift 3 and iOs 10.3, my solution - after trying many possible solution who did't work for me - for this issue was at Keychain Access. I have deleted Apple Worldwide Developer Relations Certificate Authority and then I have downloaded and installed a new one. After that, I have changed "trust"(double-click the certificate) from "always" to "system default". Now everything is fine.



回答7:

Ok. i solve this a little bit different way. As you know, grater than Xcode 7, you can run your iOS project(only one iphone) on your iphone without purchase Apple Developer Program(registration is enough).

  • if you have a Apple ID and not purchased yet.
  • And you was build on the different iPhone(Divece A)
  • Now, you want to build different iPhone(Divece B)

for this scenario, you can get an error which is detailed below

dyld: Library not loaded: @rpath/libswiftCore.dylib uzun hali de dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /private/var/mobile/Containers/Bundle/Application/LONGSERIALNUMBER/AppName.app/AppName Reason: no suitable image found. Did find: /private/var/mobile/Containers/Bundle/Application/LONGSERIALNUMBER/AppName.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x008A1000, size=0x001A4000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/LONGSERIALNUMBER/APPLICATION_NAME/Frameworks/libswiftCore.dylib

You must delete Provision Profile or you should get new Apple Developer account for new iPhone.