Reputation: 233
I am aware that there are at least 5 different question on SO with exact same description however I have tried every single answer there without any avail.
For last 12 days I am unable resolve the following error:
dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/D385AC46-BAB1-4FEB-8C08-7F78D095605E/tes.app/tes
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/D385AC46-BAB1-4FEB-8C08-7F78D095605E/tes.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x1000B0000, size=0x0018C000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/D385AC46-BAB1-4FEB-8C08-7F78D095605E/tes.app/Frameworks/libswiftCore.dylib
Is there anyone else who can help ? Looks like I wasted $99 on Apple's no-language.
Upvotes: 4
Views: 1473
Reputation: 483
I had to delete all apple certificates and regenerate my development/distribution certificate.
I also added the Apple WWDRCA certificate and deleted the expired ones using following steps:
Upvotes: 0
Reputation: 46
For what it's worth, I do not have a detail reasoning backing my solution, but just a theory.
I too was in you situation, trying failed solution after solution, only to continue running in circles hoping that a magic update from Apple would solve the issue. I've gone through the revoking of certificates, re-installing Xcode, checking Embedded Content Contains Swift Code to 'Yes', and making sure my runpath had
@executable_path/Frameworks.
One problem I frequently and increasingly run into problems with are related to Apple increasing their file access security. This appears to be more of a problem when more than one profile are associated with a computer.
I know it's easy to ignore a lot of the jargon from error messages, but what tipped me off to the issue was the following error when the file was actually found
mmap() error
What I think is happening is while attempting to remap libswiftCore.dylib 'Reason: no suitable image found. Did find:' the mapping from the expected file to the actual file location, a file permission restriction is being enforced that is not properly handled, therefore causing the app to crash.
What I did? Force authentication for all my certificates related to iOS development. This action being, going to my keychain access and clicking on the certificates private key's and forcing my access control to 'confirm before allowing access', and setting my Trust level of the Certificates to system defaults. The result of this caused my project build to ask me to authenticate 50-60+ times, however, this was a lot less painful then the hours spent debugging.
This is why I said my solution does not have a specific detailed answer, as I pretty much used a catch all approach. Since I am now only recently coming to this solution, I have not done any additional testing to determine what specifically was causing the error, or if changing the access control back to allowed from Xcode will work going forward.
This is what worked for me, and from your description I believe will work for you as well.
Upvotes: 0
Reputation: 233
I eventually found the answer. I had to delete all the certificates in the chain Keychain Manager.
Upvotes: 1
Reputation: 1308
Did you check the "Embedded Content Contains Swift Code" setting in the project settings?
I found it here: dyld: Library not loaded: @rpath/libswiftCore.dylib
Upvotes: 0