TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

SOLVED: Swift Data Causes Fatal Crash on Open

Forums > SwiftUI

Hi, for some reason I am having trouble installing any app on a physical device if it uses Swift Data. Even the default template crashes even without editing any of the code. These apps work just fine in the simulator. And the issue ocurs whether or not CloudKit is selected when creating a new app. I've even tried the demo app Apple includes in the documentation. The Flash Card app starting project works fine because it has no peristence set up and the end project won't even build, it just brings up a bunch of errors with the macro data as if the demo project was created before the latest updates to Swift Data.

The error that appears in Xcode when any of these apps open on a real device is:

dyld[1007]: Symbol not found: _$s9SwiftData15PersistentModelP14schemaMetadataSaySS_s10AnyKeyPathCypSgAGtGyFZTq Referenced from: <783506A8-1F28-3ED7-9335-6AB4BE02ACDF> /private/var/containers/Bundle/Application/44FED2D8-F750-4113-83D7-7838B8527032/SwiftDataTest3.app/SwiftDataTest3 Expected in: <8B52C2B3-931A-3736-B357-ECF87A41F3EB> /System/Library/Frameworks/SwiftData.framework/SwiftData

I've had this issue since Swift Data was released and on different devices across every beta so I don't know where else to look.

2      

I just started playing with SwiftData yesterday. I have a generic test app iOS, SwiftData, SwiftUI and Swift checked, ICloud not checked. It works for me with the latest Beta on the phone (iPhone 14 Pro).

2      

@ZF  

I'm having an issue with SwiftData on my physcial device as well however it's a different error I believe. I have a very basic test app that is just saving data and it works on the sim but not my phone. My error says "__abort_with_payload". This only happens when using my phone...

EDIT: I fixed mine by clearing my Xcode cache using DevCleaner app. It's free, I also reinstalled iOS 17 sim for xcode. It seemed to be limited disk space didn't allow my iOS 17 on xcode to install correctly.

2      

Turns out there was an issue with Xcode, Beta 6 and somehow I hadn't updated in a month.

Now that Xcode is updated, everything is working just fine!

2      

Hacking with Swift is sponsored by String Catalog.

SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!

Localize My App

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.