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

Using Cosmos in tvOS app with CocoaPods shows error Library not loaded: @rpath/libswiftCore.dylib #11

Closed
evgenyneu opened this issue Nov 24, 2015 · 5 comments

Comments

@evgenyneu
Copy link
Owner

@staticdreams, thanks for adding tvOS support. I was testing this change by creating a new tvOS app and adding Cosmos via CocoPods. Then I created a view in storyboard and assigned its class to CosmosView. After that I got an error:

... Base.lproj/Main.storyboard: error: IB Designables: Failed to render and update auto layout status for ViewController (BYZ-38-t0r): dlopen(Cosmos.framework, 1): Library not loaded: @rpath/libswiftCore.dylib
Referenced from: Cosmos.framework
Reason: image not found

I tried using Cosmos with file and Carthage methods in tvOS app - both worked. It is the CocoaPods method that does not work.

@staticdreams
Copy link
Contributor

@evgenyneu Yeah, I noticed that too. But that just affects IB, so you cannot preview the stars. tvOS in general has been so buggy so I barely pay attention to such small details as IBDesignables. Anyway, if you try to build and run Cosmos works, which is good enough for me until Apple fixes Xcode for tvOS and CocoaPods updates its libraries.

@staticdreams
Copy link
Contributor

@evgenyneu Ok, I may have found a way to fix this, since I got tired of relaunching my Xcode. While I could build and run the app, having this error prevented my from properly designing interface in IB.

Maybe there's a way to fix this easily from the code. I'm not that advanced on the topic.
Here's what I did: From Pods target find Cosmos in the list and under "Build Settings" -> "Build Options" find "Embedded content contains swift code". It way set to NO by default. I set it to YES. Clean, build, run et voila.

screen shot 2015-11-25 at 13 12 51

Basically I found solution here, if that helps:
http://stackoverflow.com/questions/26024100/dyld-library-not-loaded-rpath-libswiftcore-dylib

@evgenyneu
Copy link
Owner Author

Thank you for the research, @staticdreams. I have set "Embedded Content Contains Swift Code" to YES in the tvOS target of Cosmos library. The storyboard now works in CocoaPods tvOS app without any changes to build settings.

The Apple Q&A says this however:

To prevent having multiple copies of Swift libraries in your app, make sure that Embedded Content Contains Swift Code is set to NO in your embedded content.

I probably did exactly what Apple recommends against. Just something to keep an eye in the future.

@evgenyneu
Copy link
Owner Author

It looks like I was wrong when I set the "Embedded Content Contains Swift Code" to YES as it caused problems with submision to iTunes Connect. I have reverted the settings back to NO, as the Apple recommends. Let me know if the interface builder issue shows up again (it did not for me).

@evgenyneu
Copy link
Owner Author

Closing the issue. Feel free to reopen when needed.

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

2 participants