Current bundle does not have a SystemExtensions directory

Hi. I'm in the process of making changes to a MacOS SwiftUI project in order to have it be deployed using Developer ID. The project is a VPN using a packet tunnel provider so I'm converting the NetworkExtension to the SystemExtension equivalent.

I run the exported app from the Applications folder and it starts up fine but I get a log saying that the current bundle does not have a SystemExtensions directory. When I check the contents of the package, it has put the extension in the Plugins folder instead, which tells me that the extension is still being treated as an app extension rather than a system extension. When I try to run the extension from my app, I get a log saying "Provider is an app extension and therefore cannot be signed with a Developer ID certificate"

I have followed all steps listed here: https://developer.apple.com/forums/thread/125508

  • I have packet-tunnel-provider-systemextension in the Network Extensions array in the entitlements for both the main app and the extension.
  • I've got Network Extension entitlements on both identifiers and and System Extension on the main app identifier
  • I've created and imported provisioning profiles for both. No errors on either.
  • In the extension's info.plist, I have made sure to set the bundle type to SYSX
  • The product name for my extension matches it's bundle identifier
  • The extension's wrapper extension is systemextension

Can anyone think of anything I have missed which would cause Xcode to continue packaging it as an appex rather than a sysex? Or is there possibly somehow something I need to change in the swift code which Xcode will pick up on when packaging? Let me know if you need more info from me.

Thanks in advance

Replies

I have made progress with the "Current bundle does not have a SystemExtensions directory" issue. I found that the main application had a build phase which was targeting the plugins folder instead of the systemextensions folder.

Unfortunately, I am still getting "Provider is an app extension and therefore cannot be signed with a Developer ID certificate".

Is there a setting or info.plist item I have missed which would be treating it as an app extension?

Can anyone think of anything I have missed which would cause Xcode to continue packaging it as an appex rather than a sysex?

Are you signing your container app with this entitlement:

<key>com.apple.developer.system-extension.install</key>
<true/>

Are you using the OSSystemExtensionRequest API to install your Network System Extension?