Xcode 14 beta 3: Widget archival failed due to image being too large

I'm setting the .background() of my Widget with an Image, and getting this error in Xcode 14 beta 3 :

WidgetExtension[] [archiving] Widget archival failed due to image being too large [4] - (1920, 1080).

Is this a bug in Xcode, or a new intended failure I can't find documentation for yet?

I've never gotten this with previous versions of Xcode 13 for this Widget, but the error is telling me there is some sort of size constraint now potentially.

I have also this problem.

I experienced the same issue, and unfortunately, I haven't found a bypass; however, this issue is relatively easy to address by simply down-sizing the images you display on your widgets.

I use a function (attached below) to resize widget images to a width of 800 which I found to be a sweet spot.

extension UIImage {
  func resized(toWidth width: CGFloat, isOpaque: Bool = true) -> UIImage? {
    let canvas = CGSize(width: width, height: CGFloat(ceil(width/size.width * size.height)))
    let format = imageRendererFormat
    format.opaque = isOpaque
    return UIGraphicsImageRenderer(size: canvas, format: format).image {
      _ in draw(in: CGRect(origin: .zero, size: canvas))
    }
  }
}

If you're using vector files (PDF, SVG), you don't need to resize your images.

Head to the image's attributes inspector and check "Preserve vector data" in front of Resizing.

Xcode 14 beta 3: Widget archival failed due to image being too large
 
 
Q