Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BrainFeverMedia opened this issue Jun 19, 2017 · 16 comments
Closed

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

BrainFeverMedia opened this issue Jun 19, 2017 · 16 comments

Comments

@BrainFeverMedia
Copy link

Using Xcode 8, it builds fine but is crashing right after launch with this error:

dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /Users/Jim/Library/Developer/CoreSimulator/Devices/71C3C61E-1604-48FF-813F-84985541B72A/data/Containers/Bundle/Application/850D7F48-B1CD-4FA8-A0C8-41ED890CF1CE/TCMaskPopView.app/Frameworks/TCMask.framework/TCMask
Reason: image not found

I've tried everything so far and no luck:

  • Runpath Search Paths: @executable_path/Frameworks
  • Always Embed Swift Standard Libraries = YES
  • Clean and Clean Build Folder...
  • Delete everything in Derived Data Folder
  • Reinstall Apple WWDR Certificate

Is there any chance you can do an Objective C framework that doesn't rely on swift? This looks like a great framework and might be exactly what I need.
Thanks!
James

@zengxinzhy
Copy link
Contributor

Hi @BrainFeverMedia

Have you added the framework to "Embedded Libraries"?
Add the framework

Is there any reason you consider an Objective C framework suits your needs better than Swift?

Thanks

@BrainFeverMedia
Copy link
Author

Yes, I followed the setup instructions exactly. This is likely an Apple bug as a swift lib is not being found. A quick search on stackoverflow reveals numerous questions about this for other apps using a swift framework.

My comment about using ObjC is born out of frustration with swift issues like this, swift being not quite ready for production code.

Thanks for your quick reply.

@zengxinzhy
Copy link
Contributor

Did you checked the "Copy items if needed" when you added those libraries?
If not sure, just remove the libraries from your project and add them again.

image

Thanks

@BrainFeverMedia
Copy link
Author

For an update, the swift example works great! This appears to be an Apple bug with an ObjC app using a swift framework. I'll see if I can figure anything out here.

@Pranoy1c
Copy link

Same issue here. With Obj-C example, I get error

dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /private/var/containers/Bundle/Application/87AA4434-A3A2-48D6-BD2F-E2382B6D7CF6/TCMaskPopView.app/Frameworks/TCMask.framework/TCMask
  Reason: image not found

I have added the libraries to Embeded Frameworks and still same error.

@jasmeet12
Copy link

jasmeet12 commented Aug 11, 2017

Same issue, I am trying to run Swift example with cocoa pods, at first I was getting error

/Users/jasmeetkaur/Downloads/TinyCrayon-iOS-SDK-master/Examples/swift/TCMaskCustomization/TCMaskCustomization/ViewController.swift:26:8: Module compiled with Swift 3.0.2 cannot be imported in Swift 3.1: /Users/jasmeetkaur/Downloads/TinyCrayon-iOS-SDK-master/Examples/swift/TCMaskCustomization/Pods/TinyCrayon/TCMask.framework/Modules/TCMask.swiftmodule/arm64.swiftmodule

To resolve the above error I tried to use swift 3.0.2, then I am getting below error

dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /private/var/containers/Bundle/Application/F3B8B48C-3F07-4FE1-8EFF-EDA093CAF8BA/TCMaskCustomization.app/Frameworks/TCMask.framework/TCMask Reason: Incompatible library version: TCMask requires version 1.0.0 or later, but libswiftCore.dylib provides version 0.0.0

@bingh0616
Copy link
Contributor

@jasmeet12 Thanks for reporting the issue. Can you share command line output when you run 'pod install'? You might not get the latest version due to pod bug.

@jasmeet12
Copy link

@bingh0616 Please find output

screen shot 2017-09-04 at 5 14 03 pm

@bingh0616
Copy link
Contributor

@jasmeet12 Our latest version is 2.2.2, do not know why pod give you 2.1.1 version. Can you try 'pod update' and then try to build using latest xcode and swift. Thanks

@jasmeet12
Copy link

I tried that Now version is 2.2.2 and now I am able to run the build thanks for the quick reply :)

@bingh0616
Copy link
Contributor

@jasmeet12 No problem, we will try to see what we can do with the pod install bug. Thanks

@miyamirz
Copy link

I faced the app crash issue quoting SIGABRT error in thread.Overview of the crash is dyld library not loaded and image not found something like that.

This was seen in xcode 9.3 version.The reason i found out was xcode is not picking up libraries dynamically so i had to do it manually which solved my crash issue.

Follow the below steps: Step 1: Go to Build Phases Step 2: Hit the '+' button at the top and select "New Copy File Phase" Step 3 : Select Destination as Frameworks and Hit the '+' button below to add files. Step 4 : Select Add Other at below, click CMD+SHIFT+G and paste the below path, /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos

Now you will be able to see some swift dylibs, Select all the swift libraries with .dylib extension and click on open.

These will get added to the embedded binaries in the general tab of app.

Create a new group in project folder and add all these libraries.

Now run your app.

Happy Coding

@Sajjon
Copy link

Sajjon commented Jun 7, 2018

@miyamirz @Pranoy1c do you know if this is a Xcode 9.3 only, i.e. is it fixed in recently released Xcode 9.4?

My own private framework cannot run its own test target due to dyld: Library not loaded: @rpath/libswiftCore.dylib because I am trying to get it working with ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES set to NO.

I got rejection when uploading to iTunesConnect when uploading the IPA, with error message:

[04:06:20]: [Transporter Error Output]: ERROR ITMS-90206: "Invalid Bundle. The bundle at 'MyiPhoneApp.app/Frameworks/Models.framework' contains disallowed file 'Frameworks'."
[04:06:20]: [Transporter Error Output]: ERROR ITMS-90206: "Invalid Bundle. The bundle at 'MyiPhoneApp.app/Frameworks/Navigation.framework' contains disallowed file 'Frameworks'."
[04:06:20]: [Transporter Error Output]: ERROR ITMS-90206: "Invalid Bundle. The bundle at 'MyiPhoneApp.app/Frameworks/ViewModels.framework' contains disallowed file 'Frameworks'."
[04:06:20]: [Transporter Error Output]: ERROR ITMS-90206: "Invalid Bundle. The bundle at 'MyiPhoneApp.app/Frameworks/Views.framework' contains disallowed file 'Frameworks'."

@Duna
Copy link

Duna commented Jul 6, 2018

For what it's worth, I hit a similar error in XCode 9.0.1. I tried uninstalling and reinstalling all my certs, but when I reinstalled, they seemed to remember the trust setting I had previously. What ended up working for me (it seems) was turning off the 'Always Trust' setting of the "Apple Worldwide Developer Relations Certification Authority" cert followed by a reboot. What a cryptic issue!

@miyamirz
Copy link

miyamirz commented Jul 6, 2018

@Sajjon Need to check on that.

@ljbdelacruz
Copy link

can someone please help me with this problem
even when creating new project i still have this error when running to physical device
but works fine in simulator

screen shot 2018-10-30 at 10 02 21 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants