Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

swift code crash ,log : dyld: Library not loaded: @rpath/libswiftCore.dylib

I debug a simple swift app , it can normally running in the simulator, but on a real machine running on the crash immediately .

system version , ios 8 xcode version , 6.0.1

crash log

dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /private/var/mobile/Containers/Bundle/Application/002E2F03-EE10-433B-B95F-AE3760E777DA/sMdp.app/sMdp Reason: no suitable image found. Did find: /private/var/mobile/Containers/Bundle/Application/002E2F03-EE10-433B-B95F-AE3760E777DA/sMdp.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x100104000, size=0x00194000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/002E2F03-EE10-433B-B95F-AE3760E777DA/sMdp.app/Frameworks/libswiftCore.dylib

like image 327
yong gao Avatar asked Sep 28 '14 08:09

yong gao


2 Answers

This issues seems to be caused by the certificate. Apple filled the Organization Unit in the certificate. So you need to request a new certificate en install that one. The field will be filled and your app will work properly.

Source (and credits to those guys): https://www.airsignapp.com/ios-apps-using-swift-crash-when-signed-with-inhouse-certificate/

like image 85
Aron K. Avatar answered Nov 05 '22 10:11

Aron K.


Just go to your certificates in Keychain , Right Click -> Get Info -> Trust - > find a field with name "When using this certificate"-> Select "use system default" option.

like image 25
Harsh K Avatar answered Nov 05 '22 08:11

Harsh K