AppShortcuts error: Command ValidateAppShortcutStringsMetadata emitted errors

In Xcode 15 beta 3 and beta 4, if you add a AppShortcuts.xcstrings catalog or legacy AppShortcuts.strings files to the project, the project will always fail to build due to the following error.

error: Unable to call validation: The data couldn’t be read because it isn’t in the correct format. (in target 'LearnAppShortcuts' from project 'LearnAppShortcuts')
Command ValidateAppShortcutStringsMetadata emitted errors but did not return a nonzero exit code to indicate failure

The error seems related to a cli called ValidateAppShortcutStringsMetadata.

Reproducing Steps

  • (1) In Xcode 15 beta 3/4, create a new iOS app project.
  • (2) Add an arbitrary AppIntent and AppShortcutsProvider.
import AppIntents

struct MyAction: AppIntent {
    static let title: LocalizedStringResource = "My Action"
    
    func perform() async throws -> some IntentResult {
        return .result()
    }
}

struct MyAppShortcts: AppShortcutsProvider {
    static var appShortcuts: [AppShortcut] {
        AppShortcut(intent: MyAction(),
                    phrases: [
                        "Perform action with \(.applicationName)"
                    ],
                    shortTitle: "Perform My Action",
                    systemImageName: "heart")
    }
}
  • (3) Create a new AppShortcuts.xcstrings catalog file and add it to the iOS target
  • (4) Build the project. The string catalog will be updated as expected. However, the build will fail.

FB12658855

In Xcode 15 beta 5, this error becomes to a warning.

warning: Unable to call validation: The data couldn’t be read because it isn’t in the correct format.

Xcode 15 beta 6 fixed the bug.

AppShortcuts error: Command ValidateAppShortcutStringsMetadata emitted errors
 
 
Q