Cannot preview in this file - name.app may have crashed

I am currently learning all about JSON parsing, starting with local JSON Files within the app. I am pretty sure I followed the various Tutorials and documentations corretly. But for some reason I get this error everytime (Cannot preview in this file - name.app may have crashed). Even when i blatenly copy code that I know works.

Please someone tell me where I am going wrong, this is driving me insane. I really like SwiftUI but this is making me wann quitt it, cause I can’t find an answer to this anywhere. I already tried cleaning the project and restartig Xcode, but no luck.

Here are screenshots of my Files:

Ok after about 2 days of trying to figure out the issue I finally found it. Turns out when I created the .json file for some reason Xcode did not add it as a bundle resource. So after manually adding it, it all now works like a charm

39

1 Like

Awesome!
When you add your json file to Xcode, make sure you enable that target membership. (left arrow in my screenshot below)

After adding the file, you can double check that it will be included by selecting the file and then looking in the identity inspector (right arrow in my screenshot below)
CloudApp