0

I have a somewhat frustrating problem with exporting a compiled copy of a Mac App to my desktop and have it run. First some background...

The app contains two referenced subprojects. The first project creates an archive and the second one creates a framework. They are both used by the main project to perform certain functions.

xcode project display

The app runs fine within Xcode. The problem start when I archive it and try to export it to my desktop to see how well it runs on it's own. I use the regular procedures for this but when I try and start the app from my desktop, it won't load. There's a message saying that the dynamic loader can't find the framework object. The part of the error report that looks most helpful says this...

Dyld Error Message: Library not loaded: @rpath/JXLS.framework/Versions/A/JXLS

Referenced from: /Users/USER/BuntingSimulator.app/Contents/MacOS/Baseball Situation Simulator

Reason: image not found

JXLS does exist but it's definitely not in the exported Mac app bundle. Anybody have any suggestions on where to look or what to look for? My suspicions lay in the value of @rpath and how the subproject is referenced or built within the main project.

Thanks in advance.

This was added in after I got the answer below. In case anyone needs to use this I thought I'd illustrate the changes made to the project as they are a bit obscure...

First, need to add a copy files step into the build phase into the main target. What does that mean?

End result of the first step

The detail steps are:

1: click on the main target for the main project 2: select buid phases 3: click on the plus sign to add a build phase 4: will get a pop up box (select New Copy Files Phase) 5: change 'destination' selection to 'frameworks' 6: drag the framework object from the left panel into the name section of the new copy phase you just created

Second, need to go into the 'build settings' of the framework target and replace @rpath to @executable_path/../Frameworks

Final result of second step

joseph ruth
  • 219
  • 2
  • 12

1 Answers1

1

If you are doing this for your own use, make sure you copy the JXLS to /System/Library/Frameworks.

Otherwise, look at this answer.

Community
  • 1
  • 1
  • That did work. That of course begs the question on how to make this work when I ship it up to the app store. I'll follow the link and see what goes on. Thanks for the quick answer. – joseph ruth Apr 23 '15 at 02:56