Xcode - Mac App - 启动时Bootstrap检入错误

Ker*_*g73 7 c++ opengl macos xcode

我正在用Xcode创建一个C++ Mac应用程序.我以前做过这个没有任何问题,但几个星期前我开始了一个新项目,这个问题.

发布时的消息

当我启动应用程序时,此消息在调用后出现在控制台中 SDL_GL_CreateContext

bootstrap_check_in():  (os/kern) unknown error code (44c)
Run Code Online (Sandbox Code Playgroud)

我以前从未见过这个,我不知道这意味着什么.该应用程序仍然启动.

打开弹出窗口

osascript不再有效.调用此命令时

osascript  -e 'try' -e 'POSIX path of ( choose file name with prompt "Save screenshot" default name "Screenshot.png" )' -e 'on error number -128' -e 'end try'
Run Code Online (Sandbox Code Playgroud)

此消息显示在控制台中:

2017-11-25 10:50:19.837159+1030 osascript[7910:487965] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'com.apple.view-bridge': Connection interrupted
2017-11-25 10:50:19.838056+1030 osascript[7910:487963] *** Assertion failure in +[NSXPCSharedListener connectionForListenerNamed:fromServiceNamed:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/ViewBridge/ViewBridge-341.1/NSXPCSharedListener.m:421
2017-11-25 10:50:19.838724+1030 osascript[7910:487963] *** Assertion failure in -[NSVBSavePanel viewWillInvalidate:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1561.10.101/Nav.subproj/OpenAndSavePanelRemote/NSVBOpenAndSavePanels.m:387
2017-11-25 10:50:19.879032+1030 osascript[7910:487963] -[NSVBSavePanel init] caught non-fatal NSInternalInconsistencyException 'bridge absent' with backtrace
Run Code Online (Sandbox Code Playgroud)

我已经排除了堆栈跟踪.如果您希望我包含堆栈跟踪,请注释.

随机消息

有时控制台中会出现另一条消息.

2017-11-26 11:09:14.994459+1030 Buttons[28532:1663094] [User Defaults] Couldn't read values in CFPrefsPlistSource<0x6000000e6b80> (Domain: com.apple.PowerManagement, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access, detaching from cfprefsd
Run Code Online (Sandbox Code Playgroud)

路径

调用SDL_GetPrefPath在此应用程序中生成不同的路径.

这个应用程序

SDL_GetPrefPath("company", "my app") -> "/Users/indikernick/Library/Containers/company.my-app/Data/Library/Application Support/company/my app/"
Run Code Online (Sandbox Code Playgroud)

另一个没有破坏的应用程序

SDL_GetPrefPath("company", "my app") -> "/Users/indikernick/Library/Application Support/company/my app/"
Run Code Online (Sandbox Code Playgroud)

就这样

我很确定所有这些问题都是相关的.该项目在Github上,所以如果您在检查项目设置之前已经看过这个问题.如果重要,我正在使用Xcode 9.0和MacOS 10.13.1

提前感谢您的任何帮助.

p-a*_*l-o 6

看起来您的应用程序(以某种方式)沙盒化.这可以从SDL_GetPrefPath返回的路径看出,该路径~/Library/Containers以"随机"消息开头,并且明确指出:

访问应用程序容器外部的首选项需要用户首选项读取或文件读取数据沙箱访问

弹出错误消息也非常可疑:看起来您的应用程序无权访问某些系统资源.

如果您的应用程序启用了沙盒,则应检入xcode(即检查项目导航器中是否显示名为.entitlements的属性列表文件).

有关沙盒的更多信息:https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html