Unable to determine value type for type <AppEnum> when trying to use AppEnum declared in Framework
Asked Answered
C

0

8

This is on iOS 17 Beta 8 and Xcode 15 Beta 8

In my app I have a framework for code that's shared between the main app and extensions. In this framework I declared AppEntities and AppEnums. I can use them perfectly well from anywhere (main app & extensions) for things like buttons, as well as for Parameters of intents declared in the framework. They also appear in Shortcuts as intended. The problem is that when I try to use them for a WidgetConfigurationIntent's Parameters, I get an Unable to determine value type for type <AppEnum> compiler error.

The framework is imported and my AppEnums are declared public. I also tried using the AppIntentsPackage API, but that didn't do anything as far as I can tell. The only workaround I've found so far is to basically duplicate the code and redeclare the AppEnum in my extension with a different name, use that for a parameter, and then initialize the framework's version of the AppEnum (which the standard intents I use for buttons and shortcuts expect) from that. Which is not exactly elegant and not easily maintainable, so a proper solution would be much appreciated. Any ideas?

Cerumen answered 11/9, 2023 at 19:24 Comment(4)
Please provide enough code so others can better understand or reproduce the problem.Susannahsusanne
I think I am having similar issue, I guess it's a bug on Apple's side, did you solve the problem or file a feedback?Cephalopod
I have a similar issue. According to this WWDC video, Xcode generates a metadata file for the app intent at build time. In order for that to work, the AppIntents types you define have to be directly in the target or extension (not imported from a framework). developer.apple.com/videos/play/wwdc2022/10032/?time=1746Sphericity
Is your AppIntent running in-app or as an App Intents extension? I'm still wrapping my head around the differences, but it looks like it could also be related to your Error. developer.apple.com/videos/play/wwdc2022-10032/?time=1629Sphericity

© 2022 - 2025 — McMap. All rights reserved.