MacOSX splash screen not loading due to library not loaded: @ rpath / libswiftAppKit.dylib

We have a working Mac OS X splash screen as a standalone Xcode project, but we needed to use it as a target in another Xcode project, which also contains the corresponding application.

I added a goal for the screensaver, copied the code, added to this goal, etc. etc. The code is the same as in another splash screen, but in this case it generates the following error:

2015-03-10 09:43:24.766 System Preferences[32495]: Error loading /Users/pupeno/Library/Screen Savers/Ninja.saver/Contents/MacOS/Ninja: dlopen(/Users/pupeno/Library/Screen Savers/Ninja.saver/Contents/MacOS/Ninja, 265): Library not loaded: @rpath/libswiftAppKit.dylib Referenced from: /Users/pupeno/Library/Screen Savers/Ninja.saver/Contents/MacOS/Ninja Reason: image not found 2015-03-10 09:43:24.766 System Preferences[32495]: ScreenSaverModules: can't get principalClass for /Users/pupeno/Library/Screen Savers/Ninja.saver 

The library in question definitely exists:

 $ ls -w1 Library/Screen\ Savers/Ninja.saver/Contents/Frameworks/ libswiftAppKit.dylib libswiftCore.dylib libswiftCoreGraphics.dylib libswiftDarwin.dylib libswiftDispatch.dylib libswiftFoundation.dylib libswiftObjectiveC.dylib libswiftQuartzCore.dylib libswiftSecurity.dylib 

Any ideas what could be causing this?

+5
source share
2 answers

The problem was that the Runpath search path for some reason was empty for this new target. I fixed this problem by adding the following:

 @executable_path/../Frameworks @loader_path/../Frameworks 

to it (which I took from the configuration of the working screen saver). Here's what it looks like:

enter image description here

+8
source

As Pablo said, as your Runtime search path, you need the following:

 @executable_path/../Frameworks @loader_path/../Frameworks 

This should be the default value. Make sure it is. You also need to install the embedded content containing the Swift code in YES if you use Swift. It took me some time to understand.

(Xcode should completely conclude this. Oh, well, I filed the radar for a while.)

+2
source

Source: https://habr.com/ru/post/1215035/


All Articles