Network Extension (App Extension) Not Launching

I'm having a lot of trouble just getting a basic network extension startup, I have a main application that creates the configuration and requests the app extension based network extension to launch.

The network extension implements a NEPacketTunnelProvider and the application doesn't receive an error when starting the tunnel but when I inspect the networkextension system logs, I keep getting errors and the network extension itself doesn't appear to start nor does it log anything.

 log stream --predicate 'subsystem == "com.apple.networkextension"'

neagent: (NetworkExtension) [com.apple.networkextension:] Extension request with extension $(BUNDLE_ID) started with identifier (null)
neagent: (NetworkExtension) [com.apple.networkextension:] Failed to start extension $(BUNDLE_ID): Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named $(BUNDLE_ID)" UserInfo={NSDebugDescription=connection to service named $(BUNDLE_ID)}
nesessionmanager: [com.apple.networkextension:] Validation failed - no audit tokens
nesessionmanager: [com.apple.networkextension:] NEVPNTunnelPlugin($(BUNDLE_ID)[inactive]): Validation of the extension failed

The network extension is written in Objective-C as it needs to integrate with another language. It's not entirely clear what kind of executable the network extension is meant to be, is it meant to have a main entrypoint, or is it supposed to be a shared library / bundle?

Answered by DTS Engineer in 856827022

What platform are you developing for? This matters because there are important platform-specific differences between iOS (and its ‘child’ platforms) and macOS when it comes to NE.

Also, I have some general advice on how to debug problems like this in Debugging a Network Extension Provider. I recommend that you start there and then, if you aren’t able to fix things, come back here with your latest results.

It's not entirely clear what kind of executable the network extension is meant to be …

Network Extensions providers are packaged as either an app extension or a system extension, depending on the platform and distribution channel. TN3134 Network Extension provider deployment shows all the options.

If you’re using Xcode, create your NE target from the appropriate target template, for example, choose File > New > New Target and then select iOS > Network Extension. Xcode will then do the right thing.

If you’re not using Xcode then, well, things get more complex. Lemme know in that case and I can offer some suggestions.

Share and Enjoy

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

What platform are you developing for? This matters because there are important platform-specific differences between iOS (and its ‘child’ platforms) and macOS when it comes to NE.

Also, I have some general advice on how to debug problems like this in Debugging a Network Extension Provider. I recommend that you start there and then, if you aren’t able to fix things, come back here with your latest results.

It's not entirely clear what kind of executable the network extension is meant to be …

Network Extensions providers are packaged as either an app extension or a system extension, depending on the platform and distribution channel. TN3134 Network Extension provider deployment shows all the options.

If you’re using Xcode, create your NE target from the appropriate target template, for example, choose File > New > New Target and then select iOS > Network Extension. Xcode will then do the right thing.

If you’re not using Xcode then, well, things get more complex. Lemme know in that case and I can offer some suggestions.

Share and Enjoy

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

Network Extension (App Extension) Not Launching
 
 
Q