Reputation: 611
I have my images Assets.xcassets, and try to load it in my Widget View. To use images in widget too, I already set target membership for widget extension.
But the problem is it cannot load certain images (ex. HalloweenOne
, HalloweenTwo
, HalloweenThree
). The size of every images is under 10kb. (All of the images are loaded well in a app.)
Image("HalloweenOne")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(maxWidth: 50)
Upvotes: 6
Views: 2284
Reputation: 735
I'm not sure from where is the value, But the Swift Preview hinted me the following:
==================================
| RemoteHumanReadableError
|
| ArchivingError: imageTooLarge(size: (256.0, 256.0), maximumSize: (106.8, 106.8))
Upvotes: 1
Reputation: 106
We have investigated this issue. There are a few reasons:
If something is wrong, it will break all the elements of the widget.
Upvotes: 6
Reputation: 81
I also encountered the same problem. After trying many methods, I solved the problem by changing the "Asset Catalog - Compression" on the right to "GPU Smallest Size".
Upvotes: 8