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

前端 未结 30 1439
小蘑菇
小蘑菇 2020-11-22 04:27

I am trying to run a Swift app on my iPhone 4s. It works fine on the simulator, and my friend can successfully run it on his iPhone 4s. I have iOS 8 and the official release

相关标签:
30条回答
  • 2020-11-22 05:03

    I was having the same problem after moving to a new mac, and after hours, trying all the suggested answers in the questions, none of this worked for me.

    The solution for me was installing this missing certificate. http://developer.apple.com/certificationauthority/AppleWWDRCA.cer

    Found the answer here. https://stackoverflow.com/a/14495100/976628

    0 讨论(0)
  • 2020-11-22 05:03

    Xcode 7.2, iOS 9.2 on one device, 9.0 on other. Both had the error. No idea what changed that caused it, but the solutions above for the WWDR were correct for me. Install that cert and problem solved.

    https://forums.developer.apple.com/message/43547 https://forums.developer.apple.com/message/84846

    0 讨论(0)
  • 2020-11-22 05:05

    In Xcode 8 the option for Embedded Content Contains Swift Code option is no longer available.

    It has been renamed to "Always Embed Swift Standard Libraries = YES"

    0 讨论(0)
  • 2020-11-22 05:06

    For me none of the previous solutions worked. We discovered that there is an "Always Embed Swift Standard Libraries" flag in the Build Settings that needs to be set to YES. It was NO by default!

    Build Settings > Always Embed Swift Standard Libraries

    After setting this, clean the project before building again.

    For keen readers some explanation The most important part is:

    set the Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT) build setting to YES in your app as shown in Figure 2. This build setting, which specifies whether a target's product has embedded content with Swift code, tells Xcode to embed Swift standard libraries in your app when set to YES.

    enter image description here

    The flag was formerly called Embedded Content Contains Swift Code

    0 讨论(0)
  • 2020-11-22 05:06

    You have to set the Runpath Search Paths to @executable_path/Frameworks as showed in the following screenshot of Build Settings:

    If you have any embedded frameworks made in Swift, than you can set to YES the Build Options Embedded Content Contains Swift Code.

    0 讨论(0)
  • 2020-11-22 05:06

    Let's project P is importing custom library L, then you must add L into

    P -> Build Phases -> Embed Frameworks -> +. That works for me.

    0 讨论(0)
提交回复
热议问题