skip to Main Content

I am developing a macos menu bar app, and for some reason, when I archive, notarize & export the app to my Applications folder and run the app, it crashes instantly. When I use the Console app, I see the following error messages:

myapp[30188]: AppSandbox request successful

Channel could not return listener port.

activating connection: mach=false listener=false peer=false name=com.apple.hiservices-xpcservice

activating connection: mach=true listener=false peer=false name=com.apple.window_proxies

invalidated because the current process cancelled the connection by calling xpc_connection_cancel()

[app<application.com.myapp.15235459.15235465(501)>:30188] termination reported by launchd (2, 5, 5)

failed to fetch /Applications/myapp.app/Contents/_CodeSignature/CodeRequirements-1 error=-10

failed to get text offset for /Applications/myapp.app/Contents/MacOS/myapp[30188]: (#3) No such process

RBSStateCapture remove item called for untracked item 378-345-52811 (target:[app<application.com.myapp.15235459.15235465(501)>:30188])

When I run the app in Xcode (in debug mode & release mode), there are no Warning messages except this one for Sparkle (I am relatively sure it is unrelated to my issue but including here for brevity):

Warning: Background app automatically schedules for update checks but does not implement gentle reminders. As a result, users may not take notice to update alerts that show up in the background. Please visit https://sparkle-project.org/documentation/gentle-reminders for more information. This warning will only be logged once.

Here is a link to the .app file binary.

I gave my app’s binary to a friend and faced these error messages in Console app, but I have not been able to reproduce them myself.

Sandbox: myapp(9044) deny(1) file-read-data /Users/user/Downloads/myapp.app

IDENTITY_ATTRIBUTION: Failed to copy signing info for 9044, responsible for /private/var/folders/nt/40hq8tkx0tgb7c4fw5_n79wr0000gn/T/AppTranslocation/345F7E81-EE9E-4ADF-A66F-589A6647291D/d/myapp.app/Contents/MacOS/myapp: #-67065: Error Domain=NSOSStatusErrorDomain Code=-67065 "(null)"

I have tried the following to stop the app from crashing, all to no avail:

  • Clean Xcode
  • Delete Xcode Derived Data
  • Restart Mac
  • Build app with an alternative bundle identifier
  • Removed Sparkle package and re-archived, notarized app
  • Enable App Sandbox in Xcode Project > Target > Signing
  • Added com.apple.security.automation.apple-events to app entitlements file
  • Replaced the ‘Developer ID Application Certificate’ from Keychain with a newly generated certificate
  • Use Xcode Manual Signing instead of automatic. (Create dev, release provisioning profiles, app id)

Additional context

  • Xcode 15.2
  • MacOS Sonoma 14.5
  • Xcode minimum deployment: 13.0

Package Dependancies:

2

Answers


  1. Chosen as BEST ANSWER

    After viewing Console app > Crash Reports, I found that my app was crashing when unwrapping a null value. The value was null as I have only just discovered that in release archives for .app bundles, Xcode scheme environment variables are not passed to the app.

    The answer was much simpler than I initially thought and was not related to any signing issues.


  2. I use Launch at Login myself so im sure that’s not the problem.

    This apple dev forum thread has the same error but minimally different NSOSStatusErrorDomain code. I assume it is a very similar problem as you have.

    According to the DTS Engineer that is a signing problem. Please have a read in case you haven’t seen it: https://forums.developer.apple.com/forums/thread/678816

    Personal Experience:

    Im not sure what kind of problem you have but:

    1. Are you sure you take the correct app file. After notarisation, the app file that was created with the archive operation is not notarised, but a new notarized app file is generated. It is generated in the same bundle within a cryptic folder name
    2. You need hardened runtime capability for ad hoc distribution with notarisation outside of the App Store. Did you check if you have this? See following docs for a full list of requirements for notarisation: https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/#3087727
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search