FASwiftUI icon indicating copy to clipboard operation
FASwiftUI copied to clipboard

in iOS 14 widgets I have crash with "Terminated due to memory error."

Open Zalarudo opened this issue 3 years ago • 5 comments

When I run my widget in iOS simulator I seems like ok, but when I run it in real device I have crash with "Terminated due to memory error." error in console. When I disable "FAText" its works fine (but without icons). I think this happens because the icons.json file weighs more than 14 megabytes and when lib trying to decode the file into an object it wastes a lot of memory. Do you think there is a way to solve this problem? in my case I use only solid pro icons

Zalarudo avatar May 25 '22 17:05 Zalarudo

You could try editing the icons.json file to only include the icons you actually want to use. Haven't tried to use it (or anything else) with widgets but it does make sense that they wouldn't like such a massive resource in the bundle as they are supposed to be lightweight.

martyuiop avatar May 18 '23 10:05 martyuiop

My long-term goal has always been to do away with the run-time processing of the JSON file and do a code-generation script instead. That would certainly solve for problems like this.

mattmaddux avatar May 18 '23 14:05 mattmaddux

The newly introduced Macros come to mind…

mickeyl avatar Jun 29 '23 06:06 mickeyl

Interesting. I hadn't been watching the WWDC stuff very closely, but this looks promising at least. July has opened up for me so I will be exploring this a bit.

mattmaddux avatar Jun 29 '23 19:06 mattmaddux

I think you can address this by removing unused elements from icons.json

cat icons.json | jq 'del(.[] | .changes, .ligatures, .voted, .svg)'

kdo1234 avatar Oct 07 '23 15:10 kdo1234