Nawaf
Nawaf

Reputation: 117

Fatal error: attempting to create attribute with no subgraph

Whenever I run my iOS app in the simulator I get the error:

Fatal error: attempting to create attribute with no subgraph: CachedView<KFImageRenderer, ImageBinder>
(lldb)

However, the app seems to run fine in the preview. Does anyone know a fix for this issue?

Upvotes: 3

Views: 1628

Answers (3)

Kyra
Kyra

Reputation: 5407

To help anyone else. I had Text with modifiers attached to it within an overlay modifier. I changed the code a lot just to realize I could go back to the old code and change the order of the modifiers. Moving one first on the list worked.

Upvotes: 0

Prayag Gediya
Prayag Gediya

Reputation: 1118

In my case I was using .overlay() on the NavigationStack by mistake. It was working on devices with iOS 17.x and prior version but I got crash on iOS 18.

Make sure to move .overlay() or maybe other Modifiers inside the NavigationStack to fix the crash.

Upvotes: 0

shamnad sherief
shamnad sherief

Reputation: 638

In my case I had forgot to add the .environmentObejct(..) to the previews section. Also got it fixed by adding the environment to my preview.

Upvotes: 1

Related Questions