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

Replies

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.