'Edit Widget' not working for widget with dynamic options

I am developing a widget where I want the options to be dynamic. However, when I run the widget on device, long press it and tap 'Edit Widget', nothing really happens. The widget animates back and no configuration view opens.

If I open the Console app on my Mac and check for errors from the device, I can see this error being logged:

Code Block
Can't create SBHWidgetConfigurationInteraction because missing widgetDescriptor (<private>) or widgetIntent ((null))


Have I somehow misconfigured my widget or my intents file? This was working but it suddenly stopped working recently, and I can't figure out what I did wrong.

Edit: I think I've tried most of the 'usual' fixes. Cleaning and building again, restarting Xcode, restarting the device, deleting the app, etc.
I had a similar issue. I think my fix was to ensure the .intentsdefinition also has your main app as one of its targets.
Accepted Answer
@CruncyBagel Hm yeah, my .intentsdefinition file is already part of the main app target. But I think the issue is related to something like that. I will keep investigating.
Oops, I accidentally marked my response as the answer. It's not. 🥴
Okay, after some more digging I found out what the error was. Since I'm integrating this into an app that already has intent support, I had forgotten to deal with my new intent handler in the INExtension subclass.

So, the solution was this:

Code Block
class IntentHandler: INExtension {
override func handler(for intent: INIntent) -> Any? {
if intent is SomeIntent {
return SomeHandler()
}
if intent is SomeOtherIntent {
return SomeOtherIntentHandler()
}
// NOTE: this is what I had forgotten to add
if #available(iOS 14, *), intent is WidgetIntent {
return WidgetIntentHandler()
}
return nil
}
}

• I have created Intents Extension.
• Created Intents Definition file in Widget target, added it to all the three targets (app, widget, intents extension).
• Declared conformance to the intent handling protocol in IntentHandler (Intents Extension).
• Set up Intent Timeline Provider in Widget target.
• Added Siri to the app capabilities.

Yet I can't make it work.
Edit widget -> tap on a dynamic option and it says: "No options were provided for this parameter". Just stuck with this for two days now.
I managed to fix it for a cricket score app widget that I've developed for cricsmith.com.
I had to embed the intent extension in the containing app to get this working.

Click on main project target -> General tab -> Supported Intents
make sure you add your intent here.
in my app cricsmith's case I had to add 'SelectFavoriteTeamIntent'

Click on main project target -> General tab -> Frameworks, Libraries and Embedded Content
make sure you add your intent handler .appex here.
in my app cricsmith's case I had to add intent extension 'SelectFavoriteTeamIntentHandler.appex'

Hope that helps.

Did you ever find a solution for this? I am developing my widget now and am having a similar issue with the dynamic options. Thanks.

This is the problem with developing for Apple stuff, it works sometimes, then it doesn't and there is zero help anywhere.

My widgets worked fine on iOS 14 on both the iOS Simulator and a physical device.

On iOS 15 widgets work fine on the iOS Simulator, and I can select a dynamic value. Run it on a physical device and get "No options were provided for this parameter". Why not? They were fine before, so why are they broken now? Where is the Apple documentation that tells us why this has happened? Nowhere. You're left to figure it out for yourself. Which usually means asking on Star Overflow and waiting until someone else has figured it out, while you spend a week trying to fix something you didn't break.

Xcode is pretty poor at giving you hints as to how something can be fixed. Example, accidentally add your IntentHandler.swift file to your main app's target (Target Membership), and you get errors about things not being in scope, but nothing to suggest that the file shouldn't be in that target.

Worst of all, what is the experience that my customers are getting? Are their widgets working properly or not?

After waisting hours, these steps helped me

Clean project, delete derived data and delete the main app from your device.

'Edit Widget' not working for widget with dynamic options
 
 
Q