Validation failed error code when attempting to activate a Core Media I/O extension

Hi, I have been following the steps presented in https://developer.apple.com/documentation/coremediaio/creating_a_camera_extension_with_core_media_i_o to create a core media I/O camera.

However when calling

let activationRequest = OSSystemExtensionRequest.activationRequest(
              forExtensionWithIdentifier: identifier, queue: .main
            )
activationRequest.delegate = installDelegate
OSSystemExtensionManager.shared.submitRequest(activationRequest)

The delegate's request(_ request: OSSystemExtensionRequest, didFailWithError error: Error) method is being called with error code 9 (OSSystemExtensionError.Code.validationFailed) and the system dialog does not appear.

Answered by DTS Engineer in 717020022

In general, for system extensions, the Mach service name should be a ‘descendent’ of a app group that you have access to. So, if you have an app group com.example.my-product the following Mach service names are fine:

  • com.example.my-product.my-cmio (direct child)

  • com.example.my-product.my-cmio.mach (indirect child)

but the following are not:

  • my-cmio

  • com.example.my-cmio.mach

  • com.example.my-product-my-cmio

That last one is interesting because it speaks to the definition of “prefix”. That’s a convenient way to talk about this but it’s not precise. If your app group is GGG, the string prefix we look for is GGG., including the trailing dot. That’s why I always say “child” or “descendent”, to capture the concept of hierarchy.

Having said that, I’m not ‘on stage’ at WWDC trying to explain this succinctly (-:

Share and Enjoy

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

I encountered the same. When I re-watched the session, I heard Brad say the following:

And I need to ensure here that my extension's app group is prefixed by the MachServiceName in order for it to pass validation.

I changed the CMIOExtensionMachServiceName in the extension's Info.plist to the same value as my app's and extension's app group name and suddenly it passed validation. I'm not sure if this is the intended configuration. Maybe Apple's Extensions team can clarify what the "prefixed" means here and what the values should look like.

Accepted Answer

In general, for system extensions, the Mach service name should be a ‘descendent’ of a app group that you have access to. So, if you have an app group com.example.my-product the following Mach service names are fine:

  • com.example.my-product.my-cmio (direct child)

  • com.example.my-product.my-cmio.mach (indirect child)

but the following are not:

  • my-cmio

  • com.example.my-cmio.mach

  • com.example.my-product-my-cmio

That last one is interesting because it speaks to the definition of “prefix”. That’s a convenient way to talk about this but it’s not precise. If your app group is GGG, the string prefix we look for is GGG., including the trailing dot. That’s why I always say “child” or “descendent”, to capture the concept of hierarchy.

Having said that, I’m not ‘on stage’ at WWDC trying to explain this succinctly (-:

Share and Enjoy

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

I just came across this same problem. The error was:

Error Domain=OSSystemExtensionErrorDomain Code=9 "(null)"

Very grateful for the solution @eskimo. Validation works now.

Just a note: don't forget your team id prefix (com.apple.developer.team-identifier)!

If your extension's entitlements file contains:

<key>com.apple.developer.team-identifier</key><string>1234567ABC</string>
<key>com.apple.security.application-groups</key>
<array>
    <string>1234567ABC.group.com.example.myapp</string>
</array>

then your extension's Info.plist should contain:

<key>CMIOExtension</key>
<dict>
    <key>CMIOExtensionMachServiceName</key>
    <string>1234567ABC.group.com.example.myapp.service</string>
</dict>
Validation failed error code when attempting to activate a Core Media I/O extension
 
 
Q