4

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 enter image description here

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

Community
  • 1
  • 1
Sport
  • 8,570
  • 6
  • 46
  • 65

8 Answers8

11

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.
Varun
  • 759
  • 6
  • 12
6

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

Zev Eisenberg
  • 8,080
  • 5
  • 38
  • 82
Mirsat Murutoglu
  • 202
  • 2
  • 11
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/11442799) – Vini.g.fer Feb 29 '16 at 11:36
  • I cannot add an image due to less reputations. I can only add a link of the image. Thank you – Mirsat Murutoglu Mar 01 '16 at 05:59
  • Which version of Xcode has this ? 8.3 seems to be missing it – mmmmmm May 09 '17 at 14:54
  • 1
    Yea Xcode 8.3 doesnt have it, now i go to ~/Library/Developer/Xcode/DerivedData myself to delete the data – Mirsat Murutoglu May 11 '17 at 01:55
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. enter image description here

Ke Yang
  • 881
  • 1
  • 12
  • 21
2

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!

emido333
  • 144
  • 4
1

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
Ash
  • 5,525
  • 1
  • 40
  • 34
0

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.

Ivan Sinigaglia
  • 1,052
  • 7
  • 16
0

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.

Emre Gürses
  • 1,992
  • 1
  • 23
  • 28
0

I had this problem with Facebook SDK in unity build for xcode on iOS version 12 and below. The problem is Facebook SDK in version 7.21.2 but it is not in earlier versions. I used 7.21.1 and dont have problem.