Sunday, December 3, 2017

Xcode - Mac App - Bootstrap check in error on launch

Leave a Comment

I'm creating a C++ Mac app with Xcode. I've done this before without any problems but I started a new project a few weeks ago and this one has problems.

Message on launch

When I launch the app, this message appears in the console after calling SDL_GL_CreateContext

bootstrap_check_in():  (os/kern) unknown error code (44c) 

I've never seen this before and I don't know what it means. The app still launches though.

Opening popups

osascript no longer works. When this command is invoked,

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' 

this message appears in the console:

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 

I've excluded the stack trace. Comment if you want me to include the stack trace.

Random message

Sometimes another message appears in the console.

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 

Paths

Calls to SDL_GetPrefPath yield different paths in this application.

This application

SDL_GetPrefPath("company", "my app") -> "/Users/indikernick/Library/Containers/company.my-app/Data/Library/Application Support/company/my app/" 

Another application that isn't broken

SDL_GetPrefPath("company", "my app") -> "/Users/indikernick/Library/Application Support/company/my app/" 

That's all

I'm pretty sure all of these problems are related. The project is on Github so if you've seen this problem before you can check the project settings. If it matters, I'm using Xcode 9.0 and MacOS 10.13.1

Thank you in advance for any assistance.

1 Answers

Answers 1

It looks like your application is (somehow) sandboxed. This is seen from the path returned by SDL_GetPrefPath, which starts with ~/Library/Containers, and from the 'random' message, which clearly states:

accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access

The popup error message is also very suspect: it looks like your app is not entitled to access some system resource.

You should check in xcode if sandboxing is enabled for your app (i.e. check if a property list file called .entitlements is shown in the project navigator).

More on sandboxing: https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment