swift代码崩溃,日志:dyld:未加载库:@ rpath / libswiftCore.dylib

时间:2021-10-06 21:29:52

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

我调试了一个简单的swift应用程序,它通常可以在模拟器中运行,但是在真正的机器上立即运行。

system version , ios 8 xcode version , 6.0.1

系统版本,ios 8 xcode版本,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

dyld:未加载库:@ rpath / libswiftCore.dylib引用自:/private/var/mobile/Containers/Bundle/Application/002E2F03-EE10-433B-B95F-AE3760E777DA/sMdp.app/sMdp原因:找不到合适的映像。找到:/private/var/mobile/Containers/Bundle/Application/002E2F03-EE10-433B-B95F-AE3760E777DA/sMdp.app/Frameworks/libswiftCore.dylib:mmap()错误1,地址= 0x100104000,大小= 0x00194000段= __ TEXT in Segment :: map()mapping /private/var/mobile/Containers/Bundle/Application/002E2F03-EE10-433B-B95F-AE3760E777DA/sMdp.app/Frameworks/libswiftCore.dylib

2 个解决方案

#1


1  

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.

这个问题似乎是由证书引起的。 Apple在证书中填写了组织单位。因此,您需要安装一个新证书。该字段将被填充,您的应用程序将正常工作。

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

来源(和那些家伙的信誉):https://www.airsignapp.com/ios-apps-using-swift-crash-when-signed-with-inhouse-certificate/

#2


1  

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.

只需转到Keychain中的证书,右键单击 - >获取信息 - >信任 - >找到名称为“使用此证书时”的字段 - >选择“使用系统默认值”选项。

#1


1  

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.

这个问题似乎是由证书引起的。 Apple在证书中填写了组织单位。因此,您需要安装一个新证书。该字段将被填充,您的应用程序将正常工作。

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

来源(和那些家伙的信誉):https://www.airsignapp.com/ios-apps-using-swift-crash-when-signed-with-inhouse-certificate/

#2


1  

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.

只需转到Keychain中的证书,右键单击 - >获取信息 - >信任 - >找到名称为“使用此证书时”的字段 - >选择“使用系统默认值”选项。