Framework files not in bin when the import project is a remote reference


I have two console apps.

RealmConsoleApplication is using realm (import).project in the folder.
RemoteRealmConsoleApplication is using a remote reference.

If you look at the screenshot, the bin for RemoteRealmConsoleApplication doesnt contain the framework files.

If I run it I get

dyld: Library not loaded: @rpath/Realm.framework/Versions/A/Realm
Referenced from: /Users/JohnMoshakis/Documents/develop/Nougat/RealmConsole/RemoteRealmConsoleApplication/Bin/Debug/macOS/./RemoteRealmConsoleApplication
Reason: image not found
[1] 31252 abort ./RemoteRealmConsoleApplicaton

If I run the other I get
“The magic happens here”

John (3.5 MB)

Is it set to CopyLocal?

it’s not

Its RemoteRealmConsoleApplication thats not working and it has copy local set. The other one RealmConsoleApplication doesnt have it set but it does work.

Mind you I’ve never set any of the remote references as copy local and it seems to automatically be added. Also if I wanted to the option isnt available.

Fixed. CopyLocal was not supported for Cocoa .frameworks al all (except for .app bundling, which is handled separately), because (a) no-one ever needed that and (b) it’s probably a terrible idea to ship a console app that depends on .framework files deployed next to it.

Note you might still have to tweak the @rpath of the .frameworks. The way this works in Cocoa is that the framework itself contains information on where it wants to be loaded from. usually thats something like “@exepath…/Frameworks” or the like, because frameworks assume you’re building an app.


I recommend Friday Q&A 2009-11-06: Linking and Install Names as a fun read on the topic.

oh. I didn’t realize that.

1 Like