Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

iOS Swift error when viewing app on device from xcode

I am new to xcode and Swift app development. I recently bought my Apple Dev Certificate and all went fine. I've built the "FunFacts" app from the Swift course on TreeHouse. It all works fine in the simulator but when i try to view on my device, the launch screen of the app shows then just hangs there, and then xcode kicks up this error:

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

Any idea why this is happening? Ive tried everything like:

  • Reinstalling the app on device
  • Reboot of device and xcode/laptop
  • Changed a few setting from advice online

Nothing seems to work?!

13 Answers

What is the target iOS version you built the app on compared to the one you have on the device?

Target 8.1 and device is 8.1.1.

Do you think this is the issue? If so whats the resolution? Can i build for 8.1.1 or do i have to revert device to 8.1?

I've am having the same issue as Marlon. Have tried everything including the advice online to change the Embedded Content Contains Swift code - Yes.

Exactly the same error and the simulator works fine

App is looking for libswiftCore.dylib which should be in your build settings. Look into your build settings and see if it's there, if not add it and pow lol

general > embedded binaries, general > linked frameworks and libraries and build phases > link binaries with libraries.

Thanks Marlon!!!

Where do I put it in the build settings? Can't find libswiftCore.dylib anywhere

Hi Marlon, thanks for the response and help! I cant seem to see libswiftCore.dylib in those section dropdowns?

Try going into build settings and type in Swift in the search there's a build option to add embedded Swift code, turn that flag on and see if that fixes the issue. I tend to build and test a long the way on my device so I don't finish and can't launch on the device and then want to send my mac across the room lol.

Ah so annoying, that didn't work either! And yeah sadly thats what i have done, built the app then lastly testing on device!!! Frustrating!!!

Let me see what I can figure out, might look more into this and see what comes from it.

Thanks a bunch Marlon!

Yeah cheers mate!

Hi all ive found upgrading to Yosemite fixed this for me! Cheers!

Well I already had Yosemite, guess why I couldn't get the error to happen for me, lol....Glad it's fixed.

Well I already had Yosemite, guess why I couldn't get the error to happen for me, lol....Glad it's fixed.

Thanks for all the help anyway Marlon!

Yeah thanks guys! I upgraded to Yosemite and I'm right!