WidgetKit widget is missing from the widget gallery

My app just got rejected from TestFlight external testing review, because they were unable to find my new iOS 14 widget in the widget gallery. And when I'm debugging it all works just fine, but when I'm installing a test build from the TestFlight app, the widget is actually missing.

My minimal iOS version for the App is 13.0, and for WidgetKit widget extension it's 14.0. Deployment target is set to 14.0 (was set to 13.0, didn't help). The app comes with the bundle of three extensions: iOS 13 Today Extension, iOS 14 WidgetKit widget, and Intents extension. When I'm debugging it all works as expected.

I also have the following warning when sending the build to App Store Connect: "ITMS-90473: CFBundleVersion Mismatch - The CFBundleVersion value '156' of extension 'Intents.appex' does not match the CFBundleVersion value '157' of its containing iOS application." Can this be a problem for the widget not appearing in the gallery?
Answered by randexdev in 627501022
Ok, so I have found a workaround to this. It's all described in this tweet: twitter.com/SawyerBlatz/status/1290824315223420930
The only difference from the tweet that was mentioned by shoji_bf is that you also need to uncheck "Include bitcode for iOS content" when uploading your archive, and the widget is finally there! Hopefully it's going to stay there and all of this stuff is going to be fixed before the release. I'm going to submit that binary to external testing review, see if Apple will find the widget in the gallery too.
I also have the same problem.
In my case, what differs from randexdev is that the minimum iOS version is 11.0 and there was no ITMS-90473 warning.
I have noticed that I received a few crashes on TestFlight from my own device: WidgetKit: closure #1 in WidgetExtensionContext.getDescriptors(completion:) + 176. Unfortunately, it doesn't say anything more than that. Then only link Google finds is https://developer.apple.com/forums/thread/655776 and the solution doesn't apply to us, because all widgets must be rebuilt using the beta 4 SDK.

I have also tried to remove the widget extension target and its code completely and create it again — but this had no effect at all.
I found the same crash in Xcode organizer.
In reference to the tweet below, I set the "Dead Code Stripping" setting in both Widget.appex and Intents.appex to "No" and the widget is now available.
ttps://twitter.com/smartvipere75/status/1289523900754272264

But I hope to get this setting back before the official iOS 14 release.
Thank you shoji_bf for mentioning that tweet. I did what that person recommended, but unfortunately it didn’t help. Then I also switched off Dead Code Stripping for my Intents extension, that had no effect either. I even tried to switch it off for the whole project, but also had no luck here.

Meanwhile I fixed my CFBundleVersion mismatch error as well as other Siri support errors that I was having when uploading builds to TestFlight. Still no widget 😔 It’s so strange, because I can see my widget when running the app through Xcode in Release configuration.

I also see error No intent in timeline(for:with:completion:) when debugging my widget, although it successfully launches. And the method name is old in this error, too, I don’t use it anymore.
I'm having the same problem.

When I connect the device to Xcode and start debugging it works as it should, the widgets appears on the widget gallery.

I have sent two versión of the app, and both have been rejected because the widgets don't appear on the widget Gallery.

I have deleted the Intent file from the project, and nothing.

As of now, I don't know what to do.


I'm glad I'm not the only one in this.

I have found another crash that has been reported through TestFlight lately: WidgetKit: specialized closure #2 in WidgetExtensionContext.getTimeline(for:into:environment:isPreview:completion:) + 1332. I don't know if it's related or not, but I better leave it here. It has been reported several times already along with WidgetKit: closure #1 in WidgetExtensionContext.getDescriptors(completion:) + 176 in the same build.
Accepted Answer
Ok, so I have found a workaround to this. It's all described in this tweet: twitter.com/SawyerBlatz/status/1290824315223420930
The only difference from the tweet that was mentioned by shoji_bf is that you also need to uncheck "Include bitcode for iOS content" when uploading your archive, and the widget is finally there! Hopefully it's going to stay there and all of this stuff is going to be fixed before the release. I'm going to submit that binary to external testing review, see if Apple will find the widget in the gallery too.
WidgetKit widget is missing from the widget gallery
 
 
Q