title: MacOSX screensaver not loading due to Library not loaded: @rpath/libswiftAppKit.dylib
body: <p>We have a working Mac OS X screensaver as a standalone Xcode project, but we needed to have it as a target in another Xcode project that also contains a related app.</p>
  
  <p>I added a target for a screensaver, copied the code, added to that target, etc, etc. The code is the same one that works in the other screensaver, but on this one, it generates the following error:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The library in question is definitely there:</p>
  
  <pre><code>$ 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
  </code></pre>
  
  <p>Any ideas what might be causing this?</p>