WidgetKit Image Assets cannot be loaded

I'm trying to add an image to a widget.

The asset shows up correctly in SwiftUI preview but cannot be found on neither simulator or device when debugging.

The image is in the Assets.xcassets bundle of the widget.

When running the command extension I can view logs showing that the assets cannot be found:
Code Block
2020-07-29 13:12:11.074811+0400 MyWidget[680:39717] [SwiftUI] No image named 'piImage' found in asset catalog for /private/var/containers/Bundle/Application/6FB6A41F-6C09-4945-881F-94F47231BA45/SimplePi.app/PlugIns/MyWidget.appex


I've tried adding an image to the widget from the WW20 code along. Same error her

This is how I load the image:
Code Block
Image("piImage")
.renderingMode(.template)
.foregroundColor(.secondaryAccen

Submitted Feedback via FB8262535
Found a workaround by loading the ImageView with UIImage instance instead:
self.init(uiImage: UIImage(named: str))
WidgetKit Image Assets cannot be loaded
 
 
Q