Widgets not working with TestFlight since Xcode 12 beta 3

I have noticed a strange problem today. I have uploaded a build of my app to TestFlight for internal testing using Xcode 12 beta 3. The app has widgets and if I run the app locally from Xcode widgets are working on device.

However, when I install a beta from TestFlight the widgets are not suggested by iOS and I can see in the logs that the widgets are actually crashing (something is going on with WidgetKit in the crash logs).

This has started only with beta 3, I have previously used TestFlight with widgets in beta 1 and beta 2.

Does anyone else have this problem? My feedback number is FB8122742.
Answered by Mr. Brightside in 625976022
Ok, here is the solution to this problem.
  1. Make sure that you use Xcode 12 beta 4 and iOS 14 beta 4 on your devices.

  2. Make sure that you have placeholder(in:) implemented. Make sure that you don't have placeholder(with:) because that's what the previous beta of Xcode was suggesting with autocompletion and without that you won't get your placeholder working. I think this whole problem is caused by the WidgetKit methods getting renamed but that's another story.

  3. As per the release notes, you need to set "Dead Code Stripping" to NO in your extension target's build settings. This is only necessary for the extension's target. When uploading your archive to the App Store Connect, uncheck "Include bitcode for iOS content".

  4. Delete your old build from a device when installing a new beta.

That should do the trick.

This is likely due to the changes in the TimelineProvider APIs that happened in Beta 3. Have a look at this post and update to the latest APIs. https://developer.apple.com/forums/thread/655182?answerId=623062022#623062022
I am seeing the same problem that Mr. Brightside reports. I did adopt the TimelineProvider changes noted in the other thread. I filed FB8135225 with a sample project and sysdiagnose.
If I did not adopt the new TimelineProvider changes, I would not be able to run the app locally on a device from Xcode.

I did adopt the changes, the issue is related to TestFlight.
I adopted the new TimeLineProvider and it works locally but not after I distribute it through TestFlight. It's just broken now. Here is my code: https://developer.apple.com/forums/thread/655182?answerId=623190022#623190022
I have checked the logs when installing the app from Xcode and when installing it from TestFlight.

The difference is that WidgetKit is not able to get a timeline from a widget when the app is installed from TestFlight. That is the reason why the widget is not available for selection.

My best guess is that there is something wrong with signing on TestFlight server.

From TestFlight:
default 11:12:14.851813+1000 chronod [com.mr-brightside.myParcel.ParcelWidget:ParcelWidget:medium:-7973698613864559631@321.0/148.0/20.2] reload: begin
default 11:12:14.856270+1000 chronod [myParcel.ParcelWidget-B81718B65DEC] Session operation: getTimeline request.
default 11:12:14.928178+1000 chronod [myParcel.ParcelWidget-B81718B65DEC] Session operation: getTimeline error result: <private>
error 11:12:14.928569+1000 chronod [com.mr-brightside.myParcel.ParcelWidget:ParcelWidget] reload: failed with error Couldn’t communicate with a helper application.)

From Xcode:
default 11:19:45.639908+1000 chronod [com.mr-brightside.myParcel.ParcelWidget:ParcelWidget:medium:-7973698613864559631@321.0/148.0/20.2] reload: begin
default 11:19:45.802217+1000 chronod [myParcel.ParcelWidget-A713984DD536] Session operation: getTimeline request.
default 11:19:45.939728+1000 chronod [myParcel.ParcelWidget-A713984DD536] Session operation: getTimeline result.
default 11:19:46.129838+1000 chronod [com.mr-brightside.myParcel.ParcelWidget:ParcelWidget] reload: succeeded with 1 entries
default 11:19:46.131989+1000 chronod Task [84] [com.mr-brightside.myParcel.ParcelWidget:ParcelWidget:medium:-7973698613864559631@321.0/148.0/20.2] Completed

Full logs are available in FB8122742
I even set the policy to .never and the problem persists. Interestingly everything worked with TestFlight before Apple announced that now TestFlight supports HomeWidgets.

Code Block        
let timeline = Timeline(entries: [entry], policy: .never)
        completion(timeline)


I am having the same issue. @MeanRaw, were you able to fix it?
@kushsolitary no it continues to be broken. Widget works perfectly locally, but not when it is distributed using TestFlight. It worked before the announcement from Apple that TestFlight now supports HomeWidgets.
I'm beginning to think that the reason widgets don't show up with TestFlight distribution may not be a bug in TestFlight but a bug in Xcode beta 3. Has anyone tried to submit with Xcode beta 2?
Seeing this as well. I have it working with the updated APIs that dropped placeholder. It works locally but not via TestFlight. The build gets to TestFlight without errors though
When I tried submitting with Beta 2 I got an ITMS error saying I'm uploading from an incompatible version of Xcode. When I updated to Beta 3, the error went away, but now I'm running into these issues.
Same here. Is there any developer that has widgets working in beta 3 via Testflight?
I'm having the same issue on Xcode 12, beta 3. The widgets in my project don't load when installed via Testflight, I cannot even add widgets.

This also happens to me when using Ad Hoc distribution, so it's probably not an issue with TestFlight but a distribution issue.
This is a bug in beta 3, a workaround at this time is to disable "Dead Code Stripping" in Build Settings for the widget target.
With "Dead Code Stripping", you'll also have to disable "Bitcode" when submitting the archive through Xcode other it will undo the changes in the build. The widgets should appear in TF builds after these 2 steps.
Widgets not working with TestFlight since Xcode 12 beta 3
 
 
Q