Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Error with App Shortcut phrase: A single phrase can only use a single parameter

After installing the latest version of Xcode (16.3, 16E140), I get many instances of this error when building my app: Error: Multiple parameters detected in phrase. A single phrase can only use a single parameter.

Here is an example of an App Shortcut that is causing this error:

AppShortcut(
    intent: SelectModelIntent(),
    phrases: [
    "Select \(\.$model) in \(.applicationName)",
    ],
    shortTitle: LocalizedStringResource("Select Model", comment: "Title for Shortcut"),
    systemImageName: "rectangle.3.group"
)

If I replace the application name parameter with a hard-coded string, I get an error that says I need to have the application name parameter in each phrase. So is it not possible to have any other parameters in a phrase besides the application name? That seems unlikely to me.

A couple questions to better diagnose this issue:

  • Is this error being emitted as part of the Extract app intents metadata or Validate app shortcut strings metadata build step in the logs?
  • Is model an AppEntity or AppEnum?
  • Is there an associated AppShortcuts.xcstrings for this project?
  • If yes, what are the contents of that file?

It happens during the "Validate app shortcut strings metadata" build step.

model is an AppEntity.

There is an associated AppShortcuts.xcstrings for this project.

The file contains the localizations for the different phrases, most of which have not yet been entered.

If you navigate to the place in AppShortcuts.xcstrings where the error occurs (double click error in Issue navigator), are there any phrases that were localized for the locale and key that might contain multiple parameters?

A localization that contains multiple instances of the same parameter would also cause this to fail. For example: "Select ${model} in ${applicationName} for ${model}" has ${model} twice in the same string.

Accepted Answer

I deleted and re-created AppShortcuts.xcstrings, and then I got a different error about AppEnum and AppEntity being the only allowed types for a parameter. I had a phrase with a parameter that is a string. After removing that parameter from the phrase, my app builds.

Error with App Shortcut phrase: A single phrase can only use a single parameter
 
 
Q