Building the camera extension using CMake

Hello, I referred to the official camera extension example at https://developer.apple.com/documentation/coremediaio/creating_a_camera_extension_with_core_media_i_o?language=objc. I'm using CMake to build the camera extension plugin and integrate it into a Qt CMake project. When installing the system extension file, I receive a failure prompt with the following message:

Error Domain=OSSystemExtensionErrorDomain Code=8 "Invalid code signature or missing entitlements" UserInfo={NSLocalizedDescription=Invalid code signature or missing entitlements}

Here are the entitlements files for the camera extension:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>com.yealink.meeting.app</string>
</array>
</dict>
</plist>

The info.List.in file for the camera extension:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>CMIOExtension</key>
<dict>
<key>CMIOExtensionMachServiceName</key>
<string>$(TeamIdentifierPrefix)$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</dict>
</dict>
</plist>

And the entitlements file for the app:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>com.apple.developer.system-extension.install</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>com.yealink.meeting.app</string>
</array>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.personal-information.location</key>
<true/>
</dict>
</plist>

I'm looking forward to your response.

Don’t add com.apple.security.application-groups to your system extension. It’s not going to be useful (because your sysex doesn’t run as the same user as your app) and it can cause grief. See App Groups: macOS vs iOS: Fight! for oh so much backstory and this entitlement O-:

If you’re signing for development, add the com.apple.security.get-task-allow entitlement to both programs.

Beyond that, it’s hard to say what’s going on. I have two general bits of advice:

  • Using Xcode to create a test project and look at the build report, and the built product, to see how it’s set things up.

  • See Creating distribution-signed code for macOS for general advice on how to sign outside of Xcode.

And also one specific advice: My experience is that, when the System Extensions framework fails with an error like this, it usually logs more info to the system log. If you look through the log for relevant entries, you’ll like find more details about the failure.

See Your Friend the System Log for advice on how to look at the system log effectively.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Building the camera extension using CMake
 
 
Q