MacOS App在Xcode中以Debug和Release运行,但不是独立运行 [英] MacOS App Runs in Debug and Release in Xcode, but not Standalone

查看:398
本文介绍了MacOS App在Xcode中以Debug和Release运行,但不是独立运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用程序上工作了几个月了,从来没有问题让它可以在调试中运行.当我去创建我的第一个版本时,出现了这个错误:

I've been working on my apps for months and never had problem get it to run in debug. When I went to create my first release, I get this error:

Library not loaded: @rpath/MacOSGlues.framework/Versions/A/MacOSGlues
Referenced from: /Users/USER/Library/Developer/Xcode/DerivedData/JazzCat-ffbfdfrcekhzjacupibevqyrfyoh/Build/Products/Debug/jazzcat.app/Contents/MacOS/jazzcat
Reason: image not found

我正在一个还包含另一个模块的工作区中进行构建.该错误引用了该模块中的文件之一.

I'm doing the build in a workspace that also contains another module. The error references one of the files in that module.

要构建发行版本,我编辑了方案,并将"Build Configuration"更改为发行.我在Finder中找到了该应用程序,然后运行该应用程序以获取错误.如果我按xcode中的Cmd R键,则发行版本运行良好.只有当我尝试直接运行它时(即在Xcode之外).

To build the release version, I edited the scheme and changed "Build Configuration" to release. I located the app in Finder and ran it to get the error. If I press Cmd R in xcode, the release version runs fine. It's only when I try to run it directly (i.e., outside of Xcode).

我是否需要对发布进行并行设置,其中包括为调试设置的部分或全部设置?我本以为这将是一个普遍的问题,并且已经有了答案.我找不到一个.这是Xcode中工作区的快照.我假设文件是​​红色的,因为它们不受版本控制,而项目的大部分内容都在该文件中.

Is there a parallel set up that I have to do for release that includes some or all that is set up for debug? I would have thought this would have been a common problem and there would already be an answer. I couldn't find one. This is a snap shot of the workspace in Xcode. I assuming the files are red because they aren't under version control whereas the bulk of the project is.

在构建阶段"的目标依赖项"中没有任何条目.当我尝试添加一个时,我唯一的选择是我自己的项目中的源代码文件.

There are no entries in the "Target Dependencies" in the "Build Phases". When I attempt to add one, my only choices are the source code files in my own project.

SwiftAE项目是源代码.

The SwiftAE project is source code.

在jazzcat/构建设置/搜索路径/框架搜索路径下,未设置任何可用于调试,有效或发布的调试.

Under jazzcat/Build Settings/Search Paths/Framework Search Paths nothing is set for debug, which works, or release.

推荐答案

Library not loaded通常在未正确配置库依赖项时发生.首先,应该通过手动构建或通过依赖项配置更好的方法来构建库.这样库将自动构建.

Library not loaded mostly occurs when Library Dependency is not configured properly. First, the libraries should be built either by manual building or the better way by dependency configuration. That way the library will be built automatically.

应在Embedded Binaries部分

@curt:我希望您不要介意我重新链接了您的屏幕截图.

@curt: I hope you don't mind that I relinked your screenshot.

这篇关于MacOS App在Xcode中以Debug和Release运行,但不是独立运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆