dyld: Library not loaded: @rpath/libswift_stdlib_core.dylib
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!
macOS Command Line Tool with Swift Cocoa Framework: Library not loaded
Swift Package Manager sets the following, which resolved this issue for me in another project:
SWIFT_FORCE_DYNAMIC_LINK_STDLIB = YES
SWIFT_FORCE_STATIC_LINK_STDLIB = NO
Note that the search path was set to:
LD_RUNPATH_SEARCH_PATHS = $(TOOLCHAIN_DIR)/usr/lib/swift/macosx @executable_path
dyld: Library not loaded: @rpath/libswiftDispatch.dylib
I am using AVG Free for Mac. Yesterday it removed libswiftDispatch.dylib to quarantine because of 'MacOS:BitCoinMiner-AS'. This seems like a false positive, see:
https://discussions.agilebits.com/discussion/86860/avg-quarantined-1password-libswiftdispatch-dylib/p2
https://forum.avast.com/index.php?topic=216164.msg1449648#msg1449648 (AVG and Avast are the same company)
So for me the fix was restoring this file from quarantine.
Where are the Search Paths options in Xcode?
Open Xcode,
- Select Project
- Select Target
- Select Build Setting
- Type 'Search Path' in Search Box
(or both 'Library Search Paths' and 'Runpath Search Paths')
Crash on dyld: Library not loaded: /usr/lib/swift/libswift_Concurrency.dylib running on simulator
Found a solution based on what @vera-gonzalez did on her case.
THIS IS NOT A PRODUCTION CODE.
I also downloaded the PKG file from the swift snapshots https://swift.org/download/#snapshots, I got both versions (iphoneos and iphonesimulator) from /Library/Developer/toolchains/<snapshotname>/usr/lib/swift/<version>/libswift_Concurrency.dylib
After that I created a fat dylib file with lipo:
❯ lipo iphoneos/libswift_Concurrency.dylib iphonesimulator/libswift_Concurrency.dylib -create -output libswift_Concurrency.dylib
❯ lipo -info libswift_Concurrency.dylib
Architectures in the fat file: libswift_Concurrency.dylib are: armv7 armv7s i386 x86_64 arm64 arm64e
After that, I added this dylib file to my project as an Optional Library, on the target of my project.
With that trick I can build, run and archive for both device and simulator on my project for now (the discussion on Swift Forum indicates that this is going to be fixed sometime, but meanwhile, we can test our apps with this)
Related Topics
Custom Radix Columns (+Special Characters)
How to Override Setter in Swift
How to Print Http Request to Console
"'Init' Is Deprecated" Warning After Swift4 Convert
Nstoolbarflexiblespaceitem Is Constraint to Nssplitviewitem in Swift
Naming Convention for Private Properties
Swift Difference Between Double and Float64
Can't Get Throws to Work with Function with Completion Handler
How to Update UIviewrepresentable with Observableobject
What Was The Reason for Swift Assignment Evaluation to Void
Errors Encountered While Discovering Extensions: Error Domain=Pluginkit Code=13 "Query Cancelled"
Location Access Request in iOS 11
Convert Time String into Date Swift
More Precision Than Double in Swift
Key Data Not Storing to Icloud with Nsubiquitouskeyvaluestore.Defaultstore
Ambiguous Use of 'Filter' When Converting Project to Swift 4