Post not yet marked as solved
So I've been developing happily with CoreData+CloudKit for a while now, and really haven't run into any issues until this. I've migrated my model a couple of times, and it worked fine, but this was the first time I added a new entity to the model. If I run on a device (any device, iPhone, iPad, Mac via Catalyst), I get a migration error. Here's the entirety of my persistentContainer setup: public var persistentContainer: NSPersistentContainer = {
let modelPath = Bundle(for: CoreDataStack.self).url(forResource: "Progress", withExtension: "momd")!
let model = NSManagedObjectModel(contentsOf: modelPath)!
let container = NSPersistentCloudKitContainer(name: "Progress", managedObjectModel: model)
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
print(storeDescription)
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()And here's the error I'm getting:Callstacks=true}}}CoreData: annotation: : Attempting recovery from error encountered during addPersistentStore: Error Domain=NSCocoaErrorDomain Code=134110 "An error occurred during persistent store migration." UserInfo={sourceURL=[…].sqlite, reason=Cannot migrate store in-place: constraint violation during attempted migration, destinationURL=[…].sqlite, NSUnderlyingError=0x600000cebae0 {Error Domain=NSCocoaErrorDomain Code=134111 "(null)" UserInfo={_NSCoreDataOptimisticLockingFailureConflictsKey=(
), NSUnderlyingException=Constraint unique violation, reason=constraint violation during attempted migration, NSExceptionOmitCallstacks=true}}}Important note: I am not using contraints at all in this model. I have created a new Entity, given it a single attribute, and a single one-to-many relationship with an existing entity. That's all.Also, here's an excerpt from the logs when I have -com.apple.CoreData.MigrationDebug enabled, pointing to an issue with the CloudKit metadata tables update step:CoreData: annotation: Completed persistent history metadata tables update
CoreData: annotation: Beginning CloudKit metadata tables update
CoreData: annotation: Failed lightweight migration on connection
CoreData: annotation: Rolling back formal transactionAnyone seen this, have any idea what could be failing, or how to make cloudkit/coredata happy with a migration like this?
I'm embarrassed to say I haven't been able to google this successfully: I'm trying to save a couple of arrays of Int's (Int16 would be more than enough) as some of the attributes of a core data entity. The entity is basically a score box (like a baseball one) and it contains names of each player, and arrays for the number of points scored at each turn, among a few other standard attributes.
I'm pretty sure I need to make the array attributes Transformables. I don't know how to write the transformer. I thought I could maybe do the manual codegen, and then write some code to transform the int arrays into strings? Not sure. I can't imagine I'm the first person to try to tackle this problem, but I couldn't find anything anywhere that had a sample of something related to what I'm looking for.
If anyone could point me to a related resource, I'd really appreciate it.
Also, too, I'm a hopeless newbie.
Post not yet marked as solved
I have a class with a parameter in the form
class class_name: Codable {
var array_name = []
}
Running the code, I see I can add numbers in the array. But when I get the array in another function it says it is empty. I do it with:
let new_class = class_name()
Can it happen that the value gets reseted for calling the class again?
Every of our data row, contains an unique uuid column.
Previously, before adopting CloudKit, the uuid column has a unique constraint. This enables us to prevent data duplication.
Now, we start to integrate CloudKit, into our existing CoreData. Such unique constraint is removed. The following user flow, will cause data duplication.
Steps to cause data duplication when using CloudKit
Launch the app for the first time.
Since there is empty data, a pre-defined data with pre-defined uuid is generated.
The pre-defined data is sync to iCloud.
The app is uninstalled.
The app is re-installed.
Launch the app for the first time.
Since there is empty data, a pre-defined data with pre-defined uuid is generated.
Previous old pre-defined data from step 3, is sync to the device.
We are now having 2 pre-defined data with same uuid! :(
I was wondering, is there a way for us to prevent such duplication?
In step 8, we wish we have a way to execute such logic before written into CoreData
Check whether such uuid exists in CoreData. If not, write to CoreData.
If not, we will pick the one with latest update date, then overwrite
the existing data.
I once try to insert the above logic into https://developer.apple.com/documentation/coredata/nsmanagedobject/1506209-willsave . To prevent save, I am using self.managedObjectContext?.rollback(). But it just crash.
Do you have any idea, what are some reliable mechanism I can use, to prevent data duplication in CoreData CloudKit?
Additional info:
Before adopting CloudKit
We are using using the following CoreData stack
class CoreDataStack {
static let INSTANCE = CoreDataStack()
private init() {
}
private(set) lazy var persistentContainer: NSPersistentContainer = {
precondition(Thread.isMainThread)
let container = NSPersistentContainer(name: "***", managedObjectModel: NSManagedObjectModel.wenote)
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
// This is a serious fatal error. We will just simply terminate the app, rather than using error_log.
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
// So that when backgroundContext write to persistent store, container.viewContext will retrieve update from
// persistent store.
container.viewContext.automaticallyMergesChangesFromParent = true
// TODO: Not sure these are required...
//
//container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
//container.viewContext.undoManager = nil
//container.viewContext.shouldDeleteInaccessibleFaults = true
return container
}()
Our CoreData data schema has
Unique constraint.
Deny deletion rule for relationship.
Not having default value for non-null field.
After adopting CloudKit
class CoreDataStack {
static let INSTANCE = CoreDataStack()
private init() {
}
private(set) lazy var persistentContainer: NSPersistentContainer = {
precondition(Thread.isMainThread)
let container = NSPersistentCloudKitContainer(name: "***", managedObjectModel: NSManagedObjectModel.wenote)
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
// This is a serious fatal error. We will just simply terminate the app, rather than using error_log.
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
// So that when backgroundContext write to persistent store, container.viewContext will retrieve update from
// persistent store.
container.viewContext.automaticallyMergesChangesFromParent = true
// TODO: Not sure these are required...
//
//container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
//container.viewContext.undoManager = nil
//container.viewContext.shouldDeleteInaccessibleFaults = true
return container
}()
We change the CoreData data schema to
Not having unique constraint.
Nullify deletion rule for relationship.
Having default value for non-null field.
Based on a feedback of a Developer Technical Support engineer from https://developer.apple.com/forums/thread/699634?login=true , hen mentioned we can
Detecting Relevant Changes by Consuming Store Persistent History
Removing Duplicate Data
But, it isn't entirely clear on how it should be implemented, as the github link provided in broken.
Post not yet marked as solved
Anyone have a really good YouTube tutorial on how to implement an image as binary data in core data? Thanks!
Post not yet marked as solved
We're seeing a rare issue in the field that I haven't been able to reproduce. The app primarily uses a main queue managed object context, with a couple of other private queue contexts for specialized cases. Those cases do not modify objects that are also modified in the main queue context, so we haven't done anything to specifically handle merge conflicts. We shouldn't have any during normal operation.In at least one case, a user transitions from background to foreground and back to background in a short period of time. One of the things we do when transitioning to inactive state is to save the main queue context. During this save, sometimes it appears that all of the objects loaded in the main queue context will become conflicted. When this happens, the conflicts are very odd:Failed to save: Error Domain=NSCocoaErrorDomain Code=133020 "Could not merge changes." UserInfo={conflictList=(
"NSMergeConflict (0x11d8ec540) for NSManagedObject (0x11bf50990) with objectID '0xd00000000f340014 <x-coredata://36EBC17F-A244-4CE0-BB10-C0C5C2C3AFC1/Document/p973>' with oldVersion = 0 and newVersion = 4 and old object snapshot = { ... all attributes are null ... } and new cached row = { ... all attributes have the expected values ... }"I've encountered merge conflicts in the past, and they're due to modifications made in two contexts simultaneously. Here, we aren't modifying simultaneously, the oldVersion value is 0 and the old object snapshot is an empty object (none of the attributes are set to a value).Has anyone else seen this behavior? Is there an explanation for how an object could have an oldVersion = 0?Also, the docs don't provide quite enough detail for me to understand the difference between an "object snapshot" and a "cached row".
Post not yet marked as solved
So I have an entity in my core data model called recipe. I need to create another entity containing a recipe and a date that the recipe is assigned to. Can I do this similar to the way I've done it in the image and just save a Recipe object in the initialization of PlannedRecipe object in the Persistence file?
Basically I just need to know how to add a entity in an entity using this core data model and persistence file.
Persistence file:
import CoreData
struct PersistenceController {
static let shared = PersistenceController()
let container: NSPersistentCloudKitContainer
init(inMemory: Bool = false) {
container = NSPersistentCloudKitContainer(name: "ReciPrep")
if inMemory {
container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null")
}
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
container.viewContext.automaticallyMergesChangesFromParent = true
}
func addPlannedRecipe(recipe: Recipe,date: Date, context: NSManagedObjectContext){
let plannedRecipe = PlannedRecipe(context: context)
plannedRecipe.id = UUID()
plannedRecipe.date = Date()
plannedRecipe.recipe = recipe //Giving me an error: "Cannot assign value of type 'Recipe' to type 'Data?'"
save(context: context)
}
func save(context: NSManagedObjectContext){
do {
try context.save()
} catch {
let nsError = error as NSError
fatalError("Unresolved error \(nsError), \(nsError.userInfo)")
}
}
}
I guess this problem can be solved if I can convert a recipe into binary data or some other savable data in an entity.
Any help would be greatly appreciated.
Post not yet marked as solved
So I have a core data entity titled recipe. I'm trying to make a search bar to search the list of recipes and my method of doing so is doing a fetch request of all objects and converting it to an array of those objects and then filtering the array and displaying the results. Any idea as to how to convert a type fetch results to an array?
PS: as I'm typing this it occurred to me I could just do a for each loop and add them to the array as I go, but is there a quicker way to do this? Like a function? Thanks!!!
Post not yet marked as solved
Any insights on how to incorporate CloudKit (or CoreData) in the WidgetKit extension? Where in the WidgetKit api do I make the asynchronous call to load the data to be available for the TimelineProvider?
Post not yet marked as solved
I was wondering whether objects in Core Data (and CloudKit) conform, or are able to be conformed, to the Transferable protocol. As far as I can see there is no underlying implementation yet, but maybe this will be added as a future feature so that SwiftUI and Core Data can work better together.
In the WWDC22 session "Enhance collaboration experiences with Messages" at 10:21, a struct call Note was implementing the transferRepresentation required property and returned an object of type CKShareTransferRepresentation from its body. I couldn't find any reference to this type anywhere in the documentation and nothing else was mentioned in the session video. Maybe this is something that is going to be added soon or was removed after the video was made.
Since I want to use Core Data in my SwiftUI app and want to enable sharing features, such as collaboration via the shared database, NSManagedObject subclasses need some way of conforming to the Transferable protocol. I was hoping there would be a specialised way to do this, and the aforementioned type from the session video sort of hinted at this.
I am just asking here to see if anyone has any information about this – whether this feature is about to be released, how this issue can be solved, or another way to do this. Any help is appreciated.
Post not yet marked as solved
Hello:I have been struggling with this small piece of code foe days. Every time I resolve one problem with it, another one pops up:I seem to have resolved the problem of "Expected Pattern" but now I have the problem "Cannot call value of non-function type '[String]'Here is the code:var name = [String]() override func viewDidLoad() { super.viewDidLoad() let persistentContainer = NSPersistentContainer(name: "No_Regrets") persistentContainer.loadPersistentStores { (_, error) in if let error = error { fatalError("Failed to load Core Data stack: \(error)") } } // Creates a task with a new background context created on the fly persistentContainer.performBackgroundTask { (context) in //iterates the array let Gains = [self.gain1, self.gain2, self.gain3, self.gain4] Gains.forEach {_ in // Creates a new entry inside the context `context` and assign the array element `name` to the dog's name let gain1 = Gains(context: context) //Cannot call value of non-function type '[String]' gain1.name = name let gain2 = Gains(context: context) //Cannot call value of non-function type '[String]' gain2.name = name let gain3 = Gains(context: context) //Cannot call value of non-function type '[String]' gain3.name = name let gain4 = Gains(context: context) //Cannot call value of non-function type '[String]' gain4.name = name } do { // Saves the entries created in the `forEach` try context.save() } catch { fatalError("Failure to save context: \(error)") } }
The com.apple.developer.icloud-container-environment provides the option to set "the development or production environment to use for the iCloud containers."
My app uses Core Data, and I have implemented NSPersistentCloudKitContainer. When I am not working on schema changes, I would like my local development builds to still access the production Core Data store. However, setting this entitlement to "Production" has not produced this result... the container is still listed as 'Staging' and I can see in the CloudKit Console that the Development container is being used.
Does this entitlement only apply to direct use of CloudKit, and not to NSPersistentCloudKitContainer? If it doesn't apply to the latter, is there another way to direct NSPersistentCloudKitContainer to use the Production container?
This is an iOS app though I am beginning work on a macOS version and would like to be able to do this in both environments.
Post not yet marked as solved
Hi I put CoreData objects from one to many relationship in ForEach List and when I delete one item all objects from the List disappear. They come back after the view is reload.
List{
ForEach(viewModel.allPayments){payment in
Text("(payment.amount)")
}
.onDelete { indexSet in
viewModel.delete(at: indexSet)
}
}
.listStyle(.plain)
final class PaymentViewModel:ObservableObject{
@Published var allPayments:[Payment] = []
@Published var isNavigationLinkActive = false
var loan: Loan
init(loan: Loan) {
self.loan = loan
}
func fetchAllPayments(){
allPayments = PersistanceController.shared.fetchPayments(loan: loan)
}
func delete(at indexSet:IndexSet){
guard let indeRow = indexSet.first else {return}
PersistanceController.shared.delete(object: allPayments[indeRow])
PersistanceController.shared.save()
}
}
import CoreData
struct PersistanceController{
static let shared = PersistanceController()
let container = NSPersistentContainer(name: "Stash")
init(){
container.loadPersistentStores { description, error in
if let error = error {
print("Core Data loading error. (error.localizedDescription)")
}
}
}
var viewContext: NSManagedObjectContext{
return container.viewContext
}
func save(){
do{
try viewContext.save()
}catch{
print("Core Data saving error. (error.localizedDescription)")
}
}
func delete(object:NSManagedObject){
viewContext.delete(object)
save()
}
func fetchPayments(loan:Loan)->[Payment]{
let request:NSFetchRequest = Payment.fetchRequest()
request.predicate = NSPredicate(format: "loan == %@", loan)
request.sortDescriptors = [NSSortDescriptor(keyPath: \Payment.date, ascending: true)]
do{
return try viewContext.fetch(request)
}catch{
print("Unable to fetchPayments")
return []
}
}
}
Is there any way to delete object from Core Data in ForEach List without disappearing all object from the list?
Post not yet marked as solved
I have the model that the images show. In the entity Word I have the attribute name, that I want to be constraint. If I don't make it constraint the model works perfectly, but when I make it constraint it crashes just when opening giving this error. The only code it reads is a DataController in which I just create the container and set mergePolicy to NSmergeByPropertyObjectTrumpMergePolicy.
I think I need name in Word to be constraint. Otherwise when deleting or adding relations with train_list or test_list I get many words with the same name, when I just want one that is added or deleted from these lists.
I don't really know what are the requirements to use a constraint. Maybe there is a conflict with the relationships I have or the delete rules. Any idea?
Post not yet marked as solved
I want to add Core Data/CloudKit data persistence to my app. Currently my app only uses local on device @AppStorage. Looking for best approach to bring in @FetchRequest functionality for my views, and tie my model data into Core Data and CloudKit.
In my app currently (without Core Data) my content view has an instance of my view model (separate file) accessed using an Environment Object. I use local @AppStorage persistence. See below for my Current app architecture:
In my lab this week, i got suggestions that I can modify my app structure to incorporate Core Data + CloudKit. Would the following structure work?:
Post not yet marked as solved
I have a simple SwiftUI application with CoreData and two views. One view displays all "Place" objects. You can create new places and you can show the details for the place.
Inside the second view you can add "PlaceItem"s to a place.
The problem is that, once a new "PlaceItem" is added to the viewContext, the @NSFetchRequest seems to forget about its additional predicates, which I set in onAppear. Then every place item is shown inside the details view. Once I update the predicate manually (the refresh button), only the items from the selected place are visible again.
Any idea how this can be fixed? Here's the code for my two views:
struct PlaceView: View {
@FetchRequest(sortDescriptors: []) private var places: FetchedResults<Place>
@Environment(\.managedObjectContext) private var viewContext
var body: some View {
NavigationView {
List(places) { place in
NavigationLink {
PlaceItemsView(place: place)
} label: {
Text(place.name ?? "")
}
}
}
.toolbar {
ToolbarItem(placement: .primaryAction) {
Button {
let place = Place(context: viewContext)
place.name = NSUUID().uuidString
try! viewContext.save()
} label: {
Label("Add", systemImage: "plus")
}
}
}
.navigationTitle("Places")
}
}
struct PlaceItemsView: View {
@ObservedObject var place: Place
@FetchRequest(sortDescriptors: []) private var items: FetchedResults<PlaceItem>
@Environment(\.managedObjectContext) private var viewContext
func updatePredicate() {
items.nsPredicate = NSPredicate(format: "place == %@", place)
}
var body: some View {
NavigationView {
List(items) { item in
Text(item.name ?? "");
}
}
.onAppear(perform: updatePredicate)
.toolbar {
ToolbarItem(placement: .primaryAction) {
Button {
let item = PlaceItem(context: viewContext)
item.place = place
item.name = NSUUID().uuidString
try! viewContext.save()
} label: {
Label("Add", systemImage: "plus")
}
}
ToolbarItem(placement: .navigationBarLeading) {
Button(action: updatePredicate) {
Label("Refresh", systemImage: "arrow.clockwise")
}
}
}
.navigationTitle(place.name ?? "")
}
}
struct ContentView: View {
@Environment(\.managedObjectContext) private var viewContext
var body: some View {
NavigationView {
PlaceView()
}
}
}
Thanks!
Post not yet marked as solved
I use NSPersistentCloudKitContainer to synchronize data between iOS and macOS. After installing the app, it takes long (sometimes up to an hour) for all data to become available. Related to this, I have a few questions:
Synchronization seems only to take place when the app runs in the foreground. Is there a way to keep the app synchronizing when it is brought to the background? I have enabled remote notifications and use registerForRemoteNotifications in my app delegate (via UIApplicationDelegateAdaptor). I haven't yet experimented with background processing. Should I do that, and can you point me to some references?
Is there a way to check whether the local-stored data matches what's available on the server? E.g. checking whether a (local-stored) NSPersistentHistoryToken matches the latest NSPersistentHistoryToken on the server. Internally NSPersistentCloudKitContainer knows, as I can see log events popping up saying that there are no new data to mirror. I would like to know this to inform the user that synchronization still takes place. Currently, users are complaining about missing data, which is just not available yet.
Thanks!
Post not yet marked as solved
I am sharing my CoreData model between my iOS main app target and a new Share Extension target like this post:
This is working well for the most part except for one thing. NSFetchedResultsController is not returning results when called from the Shared Extension. What is strange though is that if I do a plain NSFetchRequest in my Share Extension, I do get CoreData results returned that were originally saved from the main app...so I think Container setup as well as model must be being shared correctly via AppContainer.
NSFetchedResultsControllerDelegate controllerDidChangeContent is never called.
Any ideas or suggestions?
import UIKit
import MobileCoreServices
class ShareViewController: UIViewController {
private(set) lazy var resultsController: NSFetchedResultsController<Person> = createFetchedResultsController()
override func viewDidLoad() {
super.viewDidLoad()
let fetchRequest = NSFetchRequest<Person>(entityName: "Person")
fetchRequest.sortDescriptors = [NSSortDescriptor(key: "date", ascending: false)]
do {
/// this works!
let persons = try CoreDataManager.shared.managedObjectContext.fetch(fetchRequest)
print("Got \(persons.count) Persons")
} catch {
print("Fetch failed")
}
activateResultsController()
}
func createFetchedResultsController() -> NSFetchedResultsController<Person> {
CoreDataManager.shared.container.viewContext.stalenessInterval = 0
CoreDataManager.shared.container.viewContext.refreshAllObjects()
CoreDataManager.shared.container.viewContext.stalenessInterval = -1
let fetchRequest = NSFetchRequest<Person>(entityName: "Person")
fetchRequest.sortDescriptors = [NSSortDescriptor(key: "date", ascending: false)]
////managedObjectContext: CoreDataManager.shared.managedObjectContext,
let controller = NSFetchedResultsController(
fetchRequest: fetchRequest,
managedObjectContext: CoreDataManager.shared.managedObjectContext,
sectionNameKeyPath: nil,
cacheName: nil
)
controller.delegate = self
return controller
}
private func activateResultsController() {
do {
try resultsController.performFetch()
} catch {
fatalError("Failed to fetch entities: \(error)")
}
}
}
// MARK: - Results Controller Delegate
extension ShareViewController: NSFetchedResultsControllerDelegate {
func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
guard let sections = resultsController.sections else {
return
}
let section = sections[0]
let rows = section.numberOfObjects
print("rows=\(rows)")
}
}
import UIKit
import CoreData
class CoreDataManager {
static let shared = CoreDataManager()
internal var container: NSPersistentContainer
var managedObjectContext: NSManagedObjectContext {
container.viewContext
}
init() {
container = NSPersistentContainer(name: Constants.name)
guard let storeDirectory = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first else {
// We'll throw a fatalError() because we can't really proceed without storeDirectory
fatalError(file: "Could not find .applicationSupportDirectory - exiting")
}
let storeURL = storeURL(for: "group.mygroup.testshareextensioncoredata", databaseName: "\(Constants.name)")
let storeDescription = NSPersistentStoreDescription(url: storeURL)
container.persistentStoreDescriptions = [storeDescription]
container.loadPersistentStores(completionHandler: { storeDescription, error in
if let error = error as NSError? {
// We'll throw a fatalError() because we can't really proceed without loading the PersistentStore
fatalError("loadPersistentStore failed \(error), \(error.userInfo)")
}
})
}
// MARK: - Core Data Saving support
func saveContext() {
managedObjectContext.performAndWait {
if managedObjectContext.hasChanges {
do {
try managedObjectContext.save()
} catch {
}
}
}
}
/// Returns a URL for the given app group and database pointing to the sqlite database.
func storeURL(for appGroup: String, databaseName: String) -> URL {
guard let fileContainer = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroup) else {
fatalError("Shared file container could not be created.")
}
return fileContainer.appendingPathComponent("\(databaseName).sqlite")
}
}
internal extension CoreDataManager {
enum Constants {
static let name = "ShareExtensionCoreDataTest"
}
}
Post not yet marked as solved
I am trying to implement a search bar in my recipe storage app. I got recommended using the .filter function that I didn’t know could be used on FetchedResults. So I did and now I’m getting errors, but not ones saying that it isn’t in the scope so I believe this is possible, just now sure how.
The ForEach loop containing the filter:
•ForEach(recipes.filter({$0.title.contains(searchingFor)})) { recipe in
Note: Recipes is just a FetchedResults type and searchingFor is just a string that comes from the search bar.
The errors:
•Value of optional type 'String?' must be unwrapped to refer to member 'contains' of wrapped base type 'String'
•Chain the optional using '?' to access member 'contains' only for non-'nil' base values
•Force-unwrap using '!' to abort execution if the optional value contains 'nil'
Any help is greatly appreciated.
Post not yet marked as solved
Dear community,
I am an indie developer and daily new to iOS development. I have created my first app some time ago - mainly based on Swift/SwiftUI and some Apple technologies such as Core Data.
So far I have luckily been spared from severe bugs but recently I have noticed a weird crash being reported via Xcode from production users that I just cannot interpret. According to the Xcode Organizer it seems somehow to be connected to Core Data (more specifically .loadPersistentStores).
I would very much appreciate any help, hints or solutions that you might have or insights from similar crashes/situations.
The crash has so far occurred on multiple devices and app versions - the only constant seems to be that all devices that produced the crash were running iOS15. Unfortunately I was not able to recreate it in the simulator or on a physical device.
Attached you can find an exemplary crash report (some redacted parts with "***").
Exemplary crash report
Thanks in advance!