Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 754 Vote(s) - 3.45 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dyld: Library not loaded: @rpath/libswift_stdlib_core.dylib

#1
I get this error after adding a Swift class to an old Xcode project.

`dyld: Library not loaded: @rpath/libswift_stdlib_core.dylib`

How can I make the project run again?
Reply

#2
For me none of the previous solutions worked. We discovered that there is a flag `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` (in earlier versions: "Embedded Content Contains Swift Code") in the Build Settings that needs to be set to YES. It was NO by default!
Reply

#3
Ran into this problem after updating to Xcode 10.2 (Swift 5). Found the following Apple link that shows two options:

[To see links please register here]


For me, I updated the MacOS to 10.14.4 (which has Swift library included in OS). Otherwise, "Download Swift 5 Runtime Support for Command Line Tools" for older OS.
Reply

#4
in my case i just use "Cmd+Shift+K" and then "Cmd+B" run its work
Reply

#5
I searched long on this issue. There are several reasons causes this issue.

If you are facing when you and Swift code/library in an Objectice C project you should try Solution 1-2-3

If you are facing this issue with a new a Swift project Solution 4 will fit you best.

### Solution 1: ###

Restart Xcode, then computer and iPhone

### Solution 2: ###

Go to project build settings and set `Always Embed Swift Standard Libraries` (previously `Embedded Content Contains Swift Code`) flag to `YES`

### Solution 3: ###

Go to project build settings and add `@executable_path/Frameworks` to `Runpath Search Paths` option

### Solution 4: ###

If none of above works, this should. Apple seems to be ninja patched certificates as mentioned in [AirSign's post](

[To see links please register here]

)

At InHouse certificates

`Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, O=Company Name, C=FR`

they added a new field named **OU**

`Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR`

so you should just recreate **certificate and provision**
Reply

#6
I've had this problem as well, only it wasn't locating `libswiftXCTest.dylib`.

The solution was to add `XCTest.framework` to the Tests target, in `Build Phases/Link Binary with Library`. I was getting this error even when I was trying to build the main target.
Reply

#7
With reference to

[To see links please register here]


**This solution worked for me :**

> It occurred on my side when building an app in the command line via
> xcodebuild and xcrun PackageApplication, signing the app with an
> enterprise profile. On our CI build servers, the certificate was set
> to "Always Trust" in the keychain (select certificate -> Get Info ->
> Trust -> "Use System Default" can be changed to "Always Trust"). I had
> to set it back to "Use System Default" in order to make this work.
> Initially we set this to "Always Trust" to work-around the keychain
> dialogs that appear after software updates and certificate updates.

Reply

#8
The reasons for this occurring are many. Having just spent a fun weekend finding yet another issue that causes this (the order of code signing), I wanted to create a summary answer that brings all the possible solutions together:

1. **Add _Embedded Content Contains Swift Code_ to project.** You need to set this flag if your app contains Swift code.
2. **Clean project**. In addition to a _Project > Clean_ you can also delete the `DerivedData` and `Build` directories. Look under the _Preferences_ for the location of `DerivedData`. `Build` should be in your project folder.
3. **Ensure _Runpath Search Paths_ contains `@executable_path/Frameworks`**.
4. **Ensure that your certificate contains your Apple Team ID in the OU (Organization Unit) field** Apple will add this for you, just revoke your existing distribution certificate and create a new one, download, install on KeyChain, regenerate all provisioning profiles, download those and rebuild.
3. **Xcode restart.** If everything is basically good, but Xcode hasn't gotten there yet.

That's the easy stuff. If you are doing your own command line build you may be creating your own `.ipa` files to upload. In that case you need to ensure the following:

1. **Make sure the version of the Swift files in `SwiftSupport/iphoneos` is the same as the version in `Contents/YourApp.app/Frameworks`** Because Swift is not yet binary compatible between version, you must ensure these versions are the one that you built your app with. You can find these libraries under `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos`.
2. **Sign the libraries and frameworks _first_**. You need to `codesign` the libraries and framework files (under `Frameworks` in the `.app` folder) first and then sign the entire `.app` tree. The `.app` tree must be signed with an `entitlements.plist` but _not_ the frameworks.

Hopefully when Swift 3.0 comes out and we no longer need to bundle Swift with our apps this whole issue will go away.
Reply

#9
I got the same problem. My solution is to move every `pod` declaration inside the `target` clause.

From:

pod 'SomePod1'
pod 'SomePod2'
pod 'SomePod3'
target 'MyAwesomeApp', :exclusive => true do

end
To:

target 'MyAwesomeApp', :exclusive => true do
pod 'SomePod1'
pod 'SomePod2'
pod 'SomePod3'
end

My guess is that if the pod declarations are put outside the target declaration, CocoaPods(0.39.0) might use the wrong xcconfig.

Pods.debug.xcconfig (X

Pods-MyAwesomeApp.debug.xcconfig (O
Reply

#10
Try to hold Alt, then go to Product -> Clean Build Folder...

Hope it will help someone..
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through