Closed pyby closed 1 year ago
Few threads on the web could help…
Using CoreData in a SPM executable https://adrian.schoenig.me/blog/2021/08/18/core-data-and-spm/
Adding Core Data to a Swift Package https://ishabazz.dev/blog/2020/7/5/using-core-data-with-swift-package-manager
iOS Shared CoreData Storage for App Groups https://github.com/maximbilan/iOS-Shared-CoreData-Storage-for-App-Groups
How to solve Core Data error: Attempt to add read-only file at path when trying to access Core Data container in the app extension today widget? https://stackoverflow.com/questions/43897795/how-to-solve-core-data-error-attempt-to-add-read-only-file-at-path-when-trying
NSPersistentContainer / Core Data / ReadOnly store https://stackoverflow.com/questions/46022820/nspersistentcontainer-core-data-readonly-store
I tried the last only, but not convinced: unit tests for migrations failed.
From Apple Swift Package Manager documentation:
/// By default, Swift Package Manager handles common resources types for Apple platforms
/// automatically. For example, you don't need to declare XIB files,
/// storyboards, Core Data file types, and asset catalogs as resources in your
/// package manifest. However, you must explicitly declare other file types — for
/// example, image files — as resources using the
/// ``Resource/process(_:localization:)`` or ``Resource/copy(_:)`` rules.
/// Alternatively, exclude resource files from a target by passing them to the
/// target initializer's ``Target/exclude`` parameter.
The resource "Data" with CoreData files seems to not be included on SPM declared resources.
Removed from the Package.swift
file, no impact on Play SRG product: Xcode "Build and Run" works, but the xcodebuild archive
still failed for same reason.
ℹ️ This issue is created after investigation on Play SRG project: https://github.com/SRGSSR/playsrg-apple/issues/299
Issue type
Incorrect behavior:
Description of the problem
Since Play SRG project is built with Xcode 14.x and running on Mac OS Ventura, a new error during the compilation appeared. This error does not return a nonzero exit code to indicate failure and in Xcode UI app, the action is done successfully, build or archive. It's annoying errors but not blocker with Xcode app. But it's block the CI, which use
fastlane
, and behind,xcodebuild
.Environment information
Reproducibility
Always reproducible
Steps to reproduce
SRGUSerData
library in the iOS target.xcodebuild -scheme MyApp -configuration Debug -destination generic/platform\=iOS archive
** ARCHIVE FAILED **
and a nonzero is returned.