SwiftUI macOS fetch json error [logging] volume does not support data protection, stripping SQLITE_OPEN_FILEPROTECTION_* flags\ SwiftUI macOS fetch json error [logging] volume does not support data protection, stripping SQLITE_OPEN_FILEPROTECTION_* flags\ json json

SwiftUI macOS fetch json error [logging] volume does not support data protection, stripping SQLITE_OPEN_FILEPROTECTION_* flags\


It looks like this error is caused by the URLSession's "default" configuration that uses the global singleton credential, cache and cookie storage objects.

Setting the configuration to "ephemeral" configuration silences this error as it doesn't write caches, cookies, or credentials to disk. This can be done by instantiating a URLSession object and using it in place of URLSession.default. E.g.,

let urlSession = URLSession(configuration: .ephemeral)urlSession.dataTask { ... }

For more information on NSURLSessionConfiguration consult Apple's documentation (https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration)


Make sure to add these two capabilities in Xcode. It allows for URLSession to make calls, both in and out :)

Make sure to add these two capabilities. It allows for network calls to be made with URLSession, both in and out