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
Stuart Morris
2,062 PointsiOS 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
Marlon Henry
6,885 PointsWhat is the target iOS version you built the app on compared to the one you have on the device?
Stuart Morris
2,062 PointsTarget 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?
Nick Larkins
5,780 PointsI'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
Marlon Henry
6,885 PointsApp 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.
Nick Larkins
5,780 PointsThanks Marlon!!!
Where do I put it in the build settings? Can't find libswiftCore.dylib anywhere
Stuart Morris
2,062 PointsHi Marlon, thanks for the response and help! I cant seem to see libswiftCore.dylib in those section dropdowns?
Marlon Henry
6,885 PointsTry 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.
Stuart Morris
2,062 PointsAh so annoying, that didn't work either! And yeah sadly thats what i have done, built the app then lastly testing on device!!! Frustrating!!!
Marlon Henry
6,885 PointsLet me see what I can figure out, might look more into this and see what comes from it.
Stuart Morris
2,062 PointsThanks a bunch Marlon!
Nick Larkins
5,780 PointsYeah cheers mate!
Stuart Morris
2,062 PointsHi all ive found upgrading to Yosemite fixed this for me! Cheers!
Marlon Henry
6,885 PointsWell I already had Yosemite, guess why I couldn't get the error to happen for me, lol....Glad it's fixed.
Marlon Henry
6,885 PointsWell I already had Yosemite, guess why I couldn't get the error to happen for me, lol....Glad it's fixed.
Stuart Morris
2,062 PointsThanks for all the help anyway Marlon!
Nick Larkins
5,780 PointsYeah thanks guys! I upgraded to Yosemite and I'm right!