Custom AppEntity struct Parameter for AppIntent not working for App Store (appintentsmetadataprocessor bug)

Hello,

I have successfully implemented AppIntents with custom parameters based on AppEntity as described in the WWDC video https://developer.apple.com/videos/play/wwdc2022/10032/.

When running the app in the iOS Simulator, everything works great.

When trying to archive manually for upload to TestFlight, or using Xcode Cloud the Extract App Intents Metadata archive step fails with the following error:

appintentsmetadataprocessor[89770:29069096] Starting appintentsmetadataprocessor export

appintentsmetadataprocessor[89770:29069096] Writing Metadata.appintents

appintentsmetadataprocessor[89770:29069096] Metadata root: /Users/***/Library/Developer/Xcode/DerivedData/YYY/Build/Intermediates.noindex/ArchiveIntermediates/ZZZ/InstallationBuildProductsLocation/Applications/GGG.app/Metadata.appintents

appintentsmetadataprocessor[89770:29069096] Writing ExtractedAppShortcutsMetadata.stringsdata file

appintentsmetadataprocessor[89770:29069096] Writing ExtractedParameterSummaryMetadata.stringsdata file

appintentsmetadataprocessor[89770:29069096] Warning: error: could not determine type for property: MyApp.MyIntent.parameter from binary

Command ExtractAppIntentsMetadata emitted errors but did not return a nonzero exit code to indicate failure

The resulting build can actually be uploaded to TestFlight, but the AppIntent does not work properly when used in Shortcuts. The custom typed parameter is shown as in the Shortcuts app as "generic" parameter and can not be properly populated, queried.

Answered by enodev in 735378022

For anyone following along, I was missing SWIFT_REFLECTION_METADATA_LEVEL=all for my release mode builds, and thus appintentsmetadataprocessor was unable to parse swift types from the binary.

FYI: Got a reply from DTS, seems to be fixed from macOS Ventura beta 11. Do not have a way to test currently.

Tried today using Xcode 14.0.1 and macOS 13 beta 11 and it still does not work...

2022-10-21T08:18:19.464926299Z	2022-10-21 01:18:15.119 appintentsmetadataprocessor[13377:45511] Starting appintentsmetadataprocessor export
2022-10-21T08:18:19.465332813Z	2022-10-21 01:18:19.180 appintentsmetadataprocessor[13377:45511] +[LNSystemProtocol startDiveProtocol]: unrecognized selector sent to class 0x7ffb5b5d74e8
2022-10-21T08:18:19.465447214Z	2022-10-21 01:18:19.208 appintentsmetadataprocessor[13377:45511] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[LNSystemProtocol startDiveProtocol]: unrecognized selector sent to class 0x7ffb5b5d74e8'
2022-10-21T08:18:19.465533034Z	*** First throw call stack:
2022-10-21T08:18:19.465625400Z	(
2022-10-21T08:18:19.465838417Z		0   CoreFoundation                      0x00007ff81a32143b __exceptionPreprocess + 242
2022-10-21T08:18:19.465919509Z		1   libobjc.A.dylib                     0x00007ff819e70e25 objc_exception_throw + 48
2022-10-21T08:18:19.466014768Z		2   CoreFoundation                      0x00007ff81a3b84c3 __CFExceptionProem + 0
2022-10-21T08:18:19.466092171Z		3   CoreFoundation                      0x00007ff81a28b69b ___forwarding___ + 1324
2022-10-21T08:18:19.466173957Z		4   CoreFoundation                      0x00007ff81a28b0d8 _CF_forwarding_prep_0 + 120
2022-10-21T08:18:19.466276709Z		5   SiriLinkBuilderCore                 0x000000010b4383b6 $s19SiriLinkBuilderCore15PrebuiltActionsV23prebuiltProtocolMappingSDySSSo08LNSystemH0CGvgTf4d_n + 4630
2022-10-21T08:18:19.466336660Z		6   SiriLinkBuilderCore                 0x000000010b438d06 $s19SiriLinkBuilderCore15PrebuiltActionsVACycfCTf4d_n + 22
2022-10-21T08:18:19.466395632Z		7   SiriLinkBuilderCore                 0x000000010b437189 $s19SiriLinkBuilderCore15PrebuiltActionsV6shared_WZ + 9
2022-10-21T08:18:19.466444276Z		8   libdispatch.dylib                   0x00007ff81a04ea44 _dispatch_client_callout + 8
2022-10-21T08:18:19.466514595Z		9   libdispatch.dylib                   0x00007ff81a04fc32 _dispatch_once_callout + 20
2022-10-21T08:18:19.466589533Z		10  SiriLinkBuilderCore                 0x000000010b3bf27a $s19SiriLinkBuilderCore0b8ManifestC0V19preBuiltActionNamesShySSGvg + 826
2022-10-21T08:18:19.466657415Z		11  SiriLinkBuilderCore                 0x000000010b3bfa33 $s19SiriLinkBuilderCore0b8ManifestC0V19gatherAbsoluteNames33_B40B2C8FAD2FF01ECB89CC6A5DB9C638LL12conformancesSDySSSaySSGGSay17AppIntentsSupport25ConformanceMetadataBundleVG_tF + 1715
2022-10-21T08:18:19.466738365Z		12  SiriLinkBuilderCore                 0x000000010b3bd2c9 $s19SiriLinkBuilderCore0b8ManifestC0V06createbE011sourceFiles10binaryURLs22linkFrameworkBinaryURL12toolchainDir12targetTriple10moduleName10deepGatherAA0eC6ResultVSay10Foundation0N0VG_Aq2PS2SSbtF + 2441
2022-10-21T08:18:19.466836207Z		13  appintentsmetadataprocessor         0x000000010a90a3ec $s27appintentsmetadataprocessor7OptionsV8_executeSay19SiriLinkBuilderCore08ManifestF5ErrorVGyF + 1084
2022-10-21T08:18:19.466904501Z		14  appintentsmetadataprocessor         0x000000010a9060d1 main + 977
2022-10-21T08:18:19.466959638Z		15  dyld                                0x00007ff819e9d310 start + 2432
2022-10-21T08:18:19.467022975Z	)
2022-10-21T08:18:19.467095495Z	libc++abi: terminating with uncaught exception of type NSException
2022-10-21T08:18:19.467233534Z	Command ExtractAppIntentsMetadata failed with a nonzero exit code
Accepted Answer

For anyone following along, I was missing SWIFT_REFLECTION_METADATA_LEVEL=all for my release mode builds, and thus appintentsmetadataprocessor was unable to parse swift types from the binary.

Custom AppEntity struct Parameter for AppIntent not working for App Store (appintentsmetadataprocessor bug)
 
 
Q