Rightpoint / Eject

An eject button for Interface Builder to generate swift code
MIT License
523 stars 24 forks source link

dyld: Library not loaded: EjectKit #6

Closed edwardloveall closed 7 years ago

edwardloveall commented 7 years ago

So I build the project, navigate to the build directory in the terminal, then run ./eject. This message spits out at me:

dyld: Library not loaded: @rpath/EjectKit.framework/Versions/A/EjectKit
  Referenced from: /Users/edwardloveall/Library/Developer/Xcode/DerivedData/Eject-gcyocjdokcfabqevoqmiqqzavoxx/Build/Products/Debug/eject
  Reason: image not found
zsh: abort

This is opposed to the generic help message that spits out into the xcode log when I build and run.

edwardloveall commented 7 years ago

This is fixed either by moving frameworks so that they are one level above the binary or changing the rpath with install_name_tool. When the project is built from xcode, this structure is created by the app bundle.

The directory structure could also look like this:

└── eject
    ├── bin
    │   └── eject
    ├── Frameworks
    │   ├── EjectKit.framework
    │   ├── libswiftAppKit.dylib
    │   ├── libswiftCore.dylib
    │   ├── libswiftCoreData.dylib
    │   ├── libswiftCoreGraphics.dylib
    │   ├── libswiftCoreImage.dylib
    │   ├── libswiftDarwin.dylib
    │   ├── libswiftDispatch.dylib
    │   ├── libswiftFoundation.dylib
    │   ├── libswiftIOKit.dylib
    │   ├── libswiftObjectiveC.dylib
    │   ├── libswiftQuartzCore.dylib
    │   ├── libswiftSwiftOnoneSupport.dylib
    │   └── libswiftXPC.dylib

I'd recommend against copying the main binary out of the app bundle so people don't have to move frameworks around.

KingOfBrian commented 7 years ago

Thanks again for the help @edwardloveall !