Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot set deployment target below OSX 10.8 (Error: dyld: Library not loaded -- Reason: Incompatible library version)

I am trying to build and run an Cocoa-based OSX app. However, when I attempt to set the deployment target to anything other than 10.8, I get a runtime error when the app attempts to launch:

dyld: Library not loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
  Referenced from: /Users/chris/Library/Developer/Xcode/DerivedData/Build/Products/Release/MyApp.app/Contents/MacOS/MyApp
  Reason: Incompatible library version: MyApp requires version 64.0.0 or later, but ApplicationServices provides version 1.0.0

As far as I can tell, there is nothing in my app that uses anything from the ApplicationServices.framework. I don't even know why it would attempt to load that library.

For reference, I'm using a few 3rd party frameworks, including Growl.framework (Growl 2.0), Sparkle.framework (Sparkle 1.5 b6), and MagicKit.framework (https://github.com/aidansteele/MagicKit)

like image 680
Chris R Avatar asked Dec 15 '22 16:12

Chris R


2 Answers

Answering my own question (after several hours of investigation):

Apparently, by linking to CoreGraphics.framework in my Desktop app project, it caused a runtime load request for the 10.8 version of the ApplicationServices framework. Fortunately, I wasn't even using anything from CoreGraphics. Removing caused the dyld loading error to stop.

like image 194
Chris R Avatar answered Dec 18 '22 06:12

Chris R


Make sure to have the ApplicationServices.framework added to the Link Binary With Libraries Phase in your target's Build Phase tab.

like image 28
Raffael Avatar answered Dec 18 '22 04:12

Raffael