App Intent in separate target doesn't work

Made a separate target for App Intents, but I don't get it to work.

The intent is shown in the Shortcuts app when registered using AppShortcutsProvider. But upon running the intent it gives this error:

Error Domain=LNActionFor- AutoShortcutPhraseFetchError Code=1 "No AutoShortcuts instance registered." UserInfo={NSLocalizedDescription=No AutoShortcuts instance registered.}

I've attached a sample project to my FA-post

FB10199299

I am facing the same issue. Tapping on a shortcut in the shortcuts app under the App Shortcuts section, shows below error:

Error Domain=LNActionFor- AutoShortcutPhraseFetchError Code=1 "No AutoShortcuts instance registered." UserInfo={NSLocalizedDescription=No AutoShortcuts instance registered.}

Here is my code:

struct OpenCurrentlyReading: AppIntent {
    static var title: LocalizedStringResource = "Open Currently Reading"

    func perform() async throws -> some PerformResult {
        return .finished
    }

    static var openAppWhenRun: Bool = true
}

public struct LibraryAppShortcuts: AppShortcutsProvider {
    public static var appShortcuts: [AppShortcut] {
        AppShortcut (
            intent: OpenCurrentlyReading(),
            phrases: ["Open Currently Reading"],
            systemImageName: "books.vertical.fill"
        )

    }
}

@main
struct FoodTruckAppShortcutsExtension: AppIntentsExtension {
}

However, same code is working fine for In-app Intents.

Same problem here. Looks like App Intents are a bit rough in beta 1.

What do you mean by separate target? Your app intents have to be compiled from within the app target to work

I also reported the issue more than a month ago ( FB10546626 ), but it’s still present in Xcode 14.0 beta 6, and it starts to be a problem:

  • it’s not a minor thing - they released App Intents and App Shortcuts and App Shortcuts don’t work in the extension where it is supposed to work;
  • if it won’t be fixed before the release of iOS 16, we need to migrate from App Intents Extension to in-app App Intents

Found one thing today, if application name included in phrase, it shows app shortcuts in shortcuts app.

App Intent in separate target doesn't work
 
 
Q