swiftbuildcompiler-errorsxcode12xcode13

Unable to create a Build due to CoreData: API Misuse when there's no Core Data in the App, and the app builds for all Simulators


I am trying to create a build (Any iOS Device (arm64)), and I get an error:

/.../CoreData:1:1: API Misuse: Attempt to serialise store access on non-owning coordinator (PSC = 0x60000381b8e0, store PSC = 0x0)

The app compiles, and runs without any errors on all Simulators, and also on real devices (tested on 3 different iPhones). I have no logs in the console, only the error, not even a warning.

My app is not using Core Data. I'm only saving a couple of user settings within UserDefaults.

The setup: Xcode 13.1 (but the same thing happens on Xcode 12), Cocoapods, Swift 5, macOS Big Sur, SwiftUI 2.0 + Combine, I'm supporting targets from iOS 14+

What I've already tried:

Any idea why this could be happening?

This post doesn't help, I've tried all the suggested options. None of them apply here. This is actually using Core Data, so it doesn't apply, and neither do all the posts they mention, nor their suggestions in the comments.


Solution

  • Fixed the issue. What I did is: