Localized App Shortcuts phrases don't work with AppIntents consumed from a Framework

Imagine we have an Xcode workspace containing two projects:

  • MyLibrary.xcodeproj holding a framework target
  • MyShortcutsApp.xcodeproj holding an app target which consumes MyLibrary framework

Both targets define App Intents and the ones from MyLibrary are exposed via AppIntentsPackage accordingly.

When trying to wrap the App Intent from framework as App Shortcut and passing localized AppShortcutPhrases I do see the following compile error: ".../Resources/de.lproj/AppShortcuts.strings:11:1: error: This AppShortcut does not map to a known action (MyLibraryIntent specified). (in target 'MyShortcutsApp' from project 'MyShortcutsApp')"

If I use the same localized App Shortcut phrases for an App Intent which is locally defined in the app target, everything works fine and also if I use the framework-provided App Intent in and App Shortcut without passing any localized phrases.

This is happening with Xcode 16.0 (16A242d), with 16.1 (16B40) and with 16.2 beta 2 (16C5013f).

I already raised this issue via FB15701779 which contains a sample project to reproduce and to further analyze the issue.

Thanks for any hint on how to solve that.

Frank

Thank you for attaching that sample project to FB15701779. You've configured your app for localization using .strings files. You can localize your App shortcuts using the newer Strings Catalog format instead (.xcstirings), with the file name AppShortcuts.xcstrings. The benefit of the newer approach is that it automatically extracts the localized content from your app during the build.

I took your app and configured it with the file as I described above. Once I did that, I got a different error message during the build:

error: The action MyLibraryIntent referenced in App Shortcut does not exist

I expected that one. The intents behind an App Shortcut need to be declared as part of the main app, and not in a library, as your sample is configured. Feel free to file an enhancement request for allowing the intents behind an App Shortcut to be defined in shared library code.

—Ed Ford,  DTS Engineer

Localized App Shortcuts phrases don't work with AppIntents consumed from a Framework
 
 
Q