Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"dyld: Library not loaded', "reason: Image not found" error in Swift 2.2 iOS with watch

I have loaded the Cardio and Result frameworks, with Carthage, and added it to linked binaries and embedded frameworks. I have added the 'copy new files' in Build Phases. It is showing the 'suitcase' icons for the frameworks in my iOS target, watch target and watch extension. The app builds but then crashes before loading any scenes on my watch.

The console error says

 "dyld: Library not loaded: @rpath/Cardio.framework/Cardio referenced from" (my realm database)  then " Reason: image not found"

Any ideas?

like image 793
Dimitri T Avatar asked Feb 06 '23 08:02

Dimitri T


1 Answers

Try this In Xcode,

1) On your application targets’ Build Phases settings tab, click the + icon and choose New Run Script Phase. Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:

/usr/local/bin/carthage copy-frameworks

2) and add the paths to the frameworks you want to use under Input Files, e.g.:

$(SRCROOT)/Carthage/Build/iOS/Cardio.framework
like image 145
Anil Kumar Avatar answered Mar 30 '23 00:03

Anil Kumar