The simulator has an issue where it doesn't raise this error. Widgets do require this background to work. Here is an example from one of mine. You will need to add containerBackground
to the view.
struct EmojiWidget: Widget {
let kind: String = "EmojiWidget"
var body: some WidgetConfiguration {
AppIntentConfiguration(kind: kind, intent: EmojiConfigurationAppIntent.self, provider: EmojiProvider()) { entry in
EmojiWidgetEntryView(entry: entry)
.containerBackground(.white.gradient, for: .widget)
}
.supportedFamilies([.systemLarge])
.supportedMountingStyles([.elevated, .recessed])
.widgetTexture(.paper)
.configurationDisplayName("Emoji Circle")
.description("Adjust the number of emojis in a radial layout")
}
}
You can optionally make this removable (let the system replace it with other backgrounds) by adding this
AppIntentConfiguration{...}
.containerBackgroundRemovable(false)