문제

I am trying to add the Parsekit framework to my OSX Xcode project. I've never added a 3rd party framework before and I can't get it to work right.

I dragged the included Xcode project into my 'Groups & Files' pane and chose to Add it to my project. I then dragged Parsekit.framework underneath the Link Binary With Libraries heading. Then I double-clicked my target app and added Parsekit as a Direct Dependency. I also added libicucore.dylib as a Linked Library (as it says to do this on their site). Finally, in the Build settings tab of my target info I set the Header Search Paths to /Users/path/to/include/directory and the Other Linker Flags to -ObjC -all_load.

Running this as a debug build work fine with no errors. However, when I build my app to release and then try to run the executable created, the app fails to load with the following error message:

MyApp cannot be opened because of a problem. Check with the developer to make sure myApp works with this version of Mac OS X.

Here is the dump from the crash reporter:

Process: MyApp [11658] Path:
/Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp Identifier: com.yourcompany.MyApp Version: ??? (???) Code Type: X86-64 (Native) Parent Process: launchd [135] Date/Time:
2010-05-24 17:08:08.475 +0100 OS Version: Mac OS X 10.6.3 (10D573) Report Version: 6Interval Since Last Report: 133300 sec Crashes Since Last Report: 3 Per-App Crashes Since Last Report: 3 Anonymous UUID:
DF0265E4-B5A0-45E1-8B71-D52A27CFDDCA

Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000002, 0x0000000000000000 Crashed Thread: 0

Dyld Error Message: Library not loaded: @executable_path/../Frameworks/ParseKit.framework/Versions/A/ParseKit Referenced from: /Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp Reason: image not found

Model: MacBookPro5,5, BootROM MBP55.00AC.B03, 2 processors, Intel Core 2 Duo, 2.53 GHz, 4 GB, SMC 1.47f2 Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB Memory Module: global_name AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.10.91.27) Bluetooth: Version 2.3.1f4, 2 service, 2 devices, 1 incoming serial ports Network Service: AirPort, AirPort, en1 Network Service: Ethernet Adaptor (en6), Ethernet, en6 Serial ATA Device: Hitachi HTS545025B9SA02, 232.89 GB Serial ATA Device: HL-DT-ST DVDRW GS23N USB Device: Built-in iSight, 0x05ac (Apple Inc.), 0x8507, 0x24400000 USB Device: Internal Memory Card Reader, 0x05ac (Apple Inc.), 0x8403, 0x26500000 USB Device: IR Receiver, 0x05ac (Apple Inc.), 0x8242, 0x04500000 USB Device: Apple Internal Keyboard / Trackpad, 0x05ac (Apple Inc.), 0x0237, 0x04600000 USB Device: BRCM2046 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0x06100000 USB Device: Bluetooth USB Host Controller, 0x05ac (Apple Inc.), 0x8213, 0x06110000

After building the app, in addition to the executable file, Xcode is also creating a file called MyApp.app.dSYM. Any idea what that is??

I am developing with Xcode 3.2.2 on an Intel MBP running 10.6.3.

Many thanks for any help offered.

Edit: New problem! Many thanks to diciu for your suggestions - initially I thought they had solved the problem. However, I copied the compiled app over to my wife's Macbook (Intel, running 10.6.3) but it won't launch. Instead I get the following error message:

You can't open the application MyApp because it is not supported on this type of Mac.

In the Build settings of MyApp, I have Valid architectures set to i386 x86_64 so it should work. What could this be caused by?

Edit: Problem solved I had inadvertently checked the Build active architecture only flag in the Build settings. Unchecking this fixed my problem. Many thanks!

도움이 되었습니까?

해결책

You have to create a "copy files" step under your target.

Right click your target, choose "Add" -> "New Build Phase" -> "New Copy Files Build Phase". For destination choose "Frameworks".

Under the newly created build phase, drag your Parsekit framework.

The dsym package from your build directory contains debugging symbols.

다른 팁

Developer of ParseKit here.

The method for doing this has changed in Xcode 4. See my answer to How to embed ParseKit as a private framework in a Mac App bundle for detailed instructions on how to do this in Xcode 4 for a Mac App.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top