XPC service failing to launch from Mac app's framework

Hi!

First time using XPC on a Mac app, and I'm stuck on a problem I can't understand. I have an app with multiple frameworks, and I'm adding an XPC service to one of the pre-existing frameworks. Right now the service is just the template that uppercases a string. I took all the necessary steps, I believe (adding the service as a target dependency, and copying it to the XPC Services folder). However, when I run it in Debug mode, I always get: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named <fully qualified service bundle ID> was invalidated: failed at lookup with error 3 - No such process." I also tested on a different, pre-existing framework, and the same thing happens.

Here's the weird parts: if I create a new framework and follow exactly the same steps, it works. I've compare the build settings between both frameworks and everything seems similar. And if I run in Release mode, the original service on the problematic framework also works! If I create a project with similar setup (app + framework with service inside it), it also works.

Looking at Console.app, I don't see anything that explains what's happening, but I may be filtering for the wrong thing.

Any help on why this fails specifically on my pre-existing frameworks and only on Debug mode is much appreciated. :)

Thank you,

Miguel Arroz

Replies

Apparently this was a code signing problem. Things weren't exactly matching between app, framework and service, and that caused the failure.