Hi There,
I have read every previous post in the forum and I still cannot figure out why my network extension cannot be launch with error:
Error Domain=OSSystemExtensionErrorDomain Code=4 "Extension not found in App bundle: perhaps App is not validly structured" UserInfo={NSLocalizedDescription=Extension not found in App bundle: perhaps App is not validly structured}
Things I have tried:
- I verified the network extension is indeed bundled into the final packet by unzip the the project and look into the package contents:
- I did tried multiple versions of different entitlements and Info.plist for both the app and extension and none of them worked.
- I did disable SIP on my Mac.
Here is my entitlements for the 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>keychain-access-groups</key>
<array>
<string>${TEAM_ID}.group.com.test.vpn</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>${TEAM_ID}.group.com.test.vpn</string>
</array>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider-systemextension</string>
</array>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.application-identifier</key>
<string>${TEAM_ID}.com.test.vpn.NetworkExtension</string>
</dict>
</plist>
Here is the info.plist for the 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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${CF_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>${VERSIONINFO_SHORT}</string>
<key>CFBundleVersion</key>
<string>${VERSIONINFO_LONG}</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>${AUTHENTICATION_SCHEME}</string>
</array>
</dict>
</array>
<key>APPClientId</key>
<string>${APP_CLIENT_ID}</string>
<key>NetworkExtension</key>
<dict>
<key>NEMachServiceName</key>
<string>${TEAM_ID}.com.test.vpn.NetworkExtension</string>
<key>NEProviderClasses</key>
<dict>
<key>com.apple.networkextension.packet-tunnel</key>
<string>VPNPacketTunnelProvider</string>
</dict>
<key>NSSystemExtensionUsageDescription</key>
<string></string>
</dict>
</dict>
</plist>
Here is the entitlements 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.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider-systemextension</string>
</array>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>${TEAM_ID}.group.com.test.vpn</string>
</array>
<key>com.apple.developer.system-extension.install</key>
<true/>
<key>com.apple.application-identifier</key>
<string>${TEAM_ID}.com.test.vpn</string>
</dict>
</plist>
Any thing did I misconfigure or any steps did I miss?