If a Notification Service Extension contains no references to shared frameworks, it loads and works as expected.
It stops working completely when I add one particular shared framework to Linked Frameworks and Libraries section. The framework that causes issues seems to be not very different from others that work, except for its slightly larger size.
The same framework loads and works OK in any other extension I tried (Notification Content, Today Widget, Share).
Here's whats going on in the system log:
pkd[159] <Info>: match returned 1 plug-ins SpringBoard(Foundation)[60] <Notice>: calling plugIn beginUsing: pkd[159] <Info>: assigning plug-in <private>(<private>) 7607AA74-3718-4708-8C72-28174BAC3980 to plugin sandbox pkd[159] <Notice>: allowing host 60 /System/Library/CoreServices/SpringBoard.app/SpringBoard to use plug-in <private>(<private>) uuid=7607AA74-3718-4708-8C72-28174BAC3980 at <private> SpringBoard(PlugInKit)[60] <Info>: preparing plug-in <private>(<private>) securityd[109] <Notice>: cert[0]: SubjectCommonName =(leaf)[]> 0 securityd[109] <Notice>: cert[0]: CheckLeafMarkerOid =(leaf)[]> 0 securityd[109] <Notice>: cert[0]: IssuerCommonName =(path)[]> 0 amfid(Security)[214] <Notice>: [leaf CheckLeafMarkerOid IssuerCommonName SubjectCommonName] amfid(libmis.dylib)[214] <Info>: Blacklist does not exist. amfid(libmis.dylib)[214] <Info>: Using empty blacklist. amfid(libmis.dylib)[214] <Info>: CreateMISAuthListWithStream: open stream failed (may be non-existing) amfid(libmis.dylib)[214] <Info>: CreateMISAuthListWithStream: creating empty auth list kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/______.framework/______ kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/______.framework/______ kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/______.framework/______ kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftCore.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftDarwin.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftDispatch.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftFoundation.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftObjectiveC.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftCoreGraphics.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftCoreImage.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftSwiftOnoneSupport.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftUIKit.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftos.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/AsyncDisplayKit.framework/AsyncDisplayKit kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/Display.framework/Display kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftAVFoundation.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftCoreAudio.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftCoreLocation.dylib kernel(Sandbox)[0] <Notice>: SandboxViolation: logd(47) deny(1) file-read-data /private/var/containers/Bundle/Application/4D8524EC-BD80-4300-9AF0-939A969F81B8/______.app/Frameworks/libswiftCoreMedia.dylib NotificationService(libsystem_trace.dylib)[336] <Notice>: bundleid: _____.NotificationService, enable_level: 0, persist_level: 0, propagate_with_activity: 0 NotificationService(libsystem_trace.dylib)[336] <Notice>: subsystem: com.apple.siri, category: Intents, enable_level: 1, persist_level: 1, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0 SpringBoard(PlugInKit)[60] <Notice>: connection to plug-in <private>(7607AA74-3718-4708-8C72-28174BAC3980) lost SpringBoard(PlugInKit)[60] <Error>: Hub connection error Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named _____.NotificationService" UserInfo={NSDebugDescription=connection to service named _____.NotificationService} SpringBoard(PlugInKit)[60] <Info>: beginUsing of 7607AA74-3718-4708-8C72-28174BAC3980 concludes with error=Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named _____.NotificationService" UserInfo={NSDebugDescription=connection to service named _____.NotificationService} SpringBoard(Foundation)[60] <Notice>: PlugInKit error in beginUsing: SpringBoard(UserNotificationsServer)[60] <Error>: Extension error whilst trying to modify push notification 3AE5-7E04: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named _____.NotificationService" UserInfo={NSDebugDescription=connection to service named _____.NotificationService} SpringBoard(Foundation)[60] <Notice>: killing invalid plugIn SpringBoard(Foundation)[60] <Notice>: completed calling plugIn beginUsing: for pid: 0