feedback-assistant / reports

Open collection of Apple Feedback Assistant reports

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FB13281659: linkd fails to extract metadata for AppIntentsPackage included in app extension

insidegui opened this issue · comments

  • Date: 2023-10-17
  • Resolution: Open
  • Area: App Intents Framework
  • OS: iOS
  • Type: Incorrect/Unexpected Behavior
  • Keywords: AppIntents, Shortcuts

Description

Summary: when an iOS app includes a framework with an AppIntentsPackage and the package is included in the AppIntents extension target, linkd on iOS fails to extract extension metadata when a release build of the app is installed from TestFlight or ad-hoc package, and hence the app’s actions won’t show up in the Shortcuts app.

I’ve been developing an app that includes a bunch of actions for Shortcuts. I need these actions to run in an AppIntents extension in order to provide the best experience for users. I also need to share a lot of the AppIntents-related code between my app and its extension, so I have opted into using a shared framework which is linked to both the main app target and my AppIntents extension target.

To make things easier, I have developed a sample project that reproduces the issue.

In the sample project, the main app is called “ActionPackageTest”, the framework is called “ActionPackage”, and the AppIntents extension is called “ActionPackageAppIntents”.

The ActionPackage framework implements a single action: “ReturnsStringAction” that just returns a string when run.

The ActionPackage framework also includes a struct called “ActionPackageIntentsPackage” that implements the “AppIntentsPackage” protocol as described in https://developer.apple.com/documentation/appintents/appintentspackage

The ActionPackageAppIntents target also implements the protocol in “ActionPackageAppIntentsExtension”, which is the extension entry point struct. In its “includedPackages” it has an array with ActionPackageIntentsPackage.self, imported from the framework.

When I build and run this app from Xcode onto my device, I can go into Shortcuts and find the “Return String” action from the app just fine.

However, once I submit the app to TestFlight then install the app on device, none of its actions show up in the Shortcuts app. The same issue can be reproduced by exporting an ad-hoc build of the app and installing the ipa directly.

Looking at console logs from the device collected shortly after installing the app and launching Shortcuts, I see an error message from the linkd process:

Unable to extract bundle metadata for codes.rambo.experiment.ActionPackageTest:
empty extensionMetadata for URL file:///private/var/containers/Bundle/Application/73211BD7-BB9E-421F-AF9F-3B2FC48C2A89/ActionPackageTest.app/ of { bundleID: codes.rambo.experiment.ActionPackageTest, URL: file:///private/var/containers/Bundle/Application/73211BD7-BB9E-421F-AF9F-3B2FC48C2A89/ActionPackageTest.app/ }"

So it looks like linkd is failing to index the app’s actions for some reason when a release build of the app is installed, but I can’t figure out the reason why.

If I implement the AppIntentsPackage protocol in my main app target then include the ActionPackageIntentsPackage.self imported from the framework in there, it will work, but then the intents will run in my app’s process, which is not what I want.

I’d like to know if there’s anything I’m doing wrong, or, if this is a system bug, if there’s any workaround I could use so that I can ship my app to beta testers.

I have already tried several devices on both iOS 17.0.3 and the latest iOS 17.1 seed (seed 3 at the time of writing), all of which had the exact same problem. Also tried multiple device reboots and language preference changes.

I’m also including in the attachments for this feedback a separate log archive file taken from an iPhone 15 Pro Max running iOS 17.0.3 shortly after installing the app from TestFlight and opening Shortcuts, where the aforementioned error message from linkd can be seen at 08:43:54.058233-0300.

I’d appreciate any help with getting this working.

Files

ActionPackageTest-XcodeProject.zip