1

1. File new project . Single View Application , Objective C . Run . Runs on iphone

2. File new project . Single View Application, Swift . Run . Following error

dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /private/var/mobile/Containers/Bundle/Application/F3FB09C8-29C3-4389-9B3F-4F355FDF8EC8/Test.app/Test
  Reason: no suitable image found.  Did find:
    /private/var/mobile/Containers/Bundle/Application/F3FB09C8-29C3-4389-9B3F-4F355FDF8EC8/Test.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x001E3000, size=0x00168000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/F3FB09C8-29C3-4389-9B3F-4F355FDF8EC8/Test.app/Frameworks/libswiftCore.dylib

Environment : Xcode Version 6.3.1 (6D1002)

Created new certificate and profile.Didn't help .

Kushal
  • 8,100
  • 9
  • 63
  • 82
  • What OS is the phone running? UPDATE: nvm, you mention an iPhone 5 with iOS 8.3 in a comment below. – atreat Apr 24 '15 at 16:56

3 Answers3

1

Go to keychain , and select the certificates .The certificates that have + sign (those are the ones that have always trust ) . Right click->Get Info-> expand the trust.Change them to "Use System Default" . This fixed for me . Do it to certificates that have + against them.

0

Check that "Embedded Content Contains Swift Code" is set to YES in your build settings.

This isn't to do with certificates.

If the above doesn't work, check that "Runpath Search Paths" is set to @executable_path/Frameworks

Beau Nouvelle
  • 6,962
  • 3
  • 39
  • 54
  • Checked "Runpath Search Paths" and it is set to @executable_path/Frameworks – user3576382 Apr 24 '15 at 13:00
  • What OS version is your iPhone running, and which iPhone model? Have you checked the related questions in the column to the right? – Beau Nouvelle Apr 24 '15 at 13:12
  • iPhone 5 (iOS 8.3) . Yes i did try the related questions . Especially this one [link] https://stackoverflow.com/questions/26024100/dyld-library-not-loaded-rpath-libswiftcore-dylib. and to isolate the issue , went to the file new project route and could reproduce the same issue. I recently updated to Xcode 6.3.1 , but cannot say for sure this caused the problem . Objective C project works fine. – user3576382 Apr 24 '15 at 13:58
0

In your build settings, Set "Embedded Content Contains Swift Code" to "YES" and "Runpath Search Paths" to "@executable_path/Frameworks".

Viren Malhan
  • 115
  • 1
  • 5
  • "Embedded Content Contains Swift Code" is "YES" and "Runpath Search Paths" is "@executable_path/Frameworks". Yet does not work. – user3576382 Apr 24 '15 at 18:16