I have used this example to create the following code:
import Foundation
import CoreLocation
let monitorName = "BeaconMonitor"
let testBeaconId = UUID(uuidString: "EDFA3FFA-D80A-4C23-9104-11B5B0B8E8F3")!
@MainActor
public class ObservableMonitorModel: ObservableObject {
private let manager: CLLocationManager
public var monitor: CLMonitor?
init() {
self.manager = CLLocationManager()
self.manager.requestWhenInUseAuthorization()
self.manager.requestAlwaysAuthorization()
}
func startMonitoringConditions() {
Task {
monitor = await CLMonitor(monitorName)
await monitor!.add(getBeaconIdentityCondition(), identifier: "Beacon")
for identifier in await monitor!.identifiers {
guard let lastEvent = await monitor!.record(for: identifier)?.lastEvent else { continue }
print(identifier, lastEvent.state)
}
for try await event in await monitor!.events {
print("Event", event.identifier, event)
}
}
}
}
func getBeaconIdentityCondition() -> CLMonitor.BeaconIdentityCondition {
CLMonitor.BeaconIdentityCondition(uuid: testBeaconId)
}
Unfortunately, running this on my iPhone only prints "Beacon CLMonitoringState". I don't see anything from the for try await block starting with "Event".
Any ideas where I've gone wrong?
Post
Replies
Boosts
Views
Activity
Context: I am trying to create a XCFramework that I can reuse it in my Swift app. My example is based on SPM (Swift Package Manager) but I had the same import error no such module when I tried to import my XCFramework in XCode.
Here is the code for XCFramework:
Package.swift
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "MySDK",
platforms: [.macOS(.v14), .iOS(.v13), .watchOS(.v6)],
products: [
.library(name: "MySDK", type: .dynamic, targets: ["MySDK"]),
],
targets: [
.target(name: "MySDK")
]
)
Sources/MySDK/my_sdk.swift
public func myHelloStr() -> String {
return "Bonjour le monde!"
}
To generate the XCFramework:
$ xcodebuild build -scheme MySDK -destination "platform=macOS" -derivedDataPath DerivedData SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
$ xcodebuild -create-xcframework -framework DerivedData/Build/Products/Debug/PackageFrameworks/MySDK.framework -output MyFramework.xcframework
I can see MyFramework.xcframework folder with
- `Info.plist`
- `macos-x86_64/MySDK.framework/MySDK`
- `macos-x86_64/MySDK.framework/Resources/Info.plist`
- `macos-x86_64/MySDK.framework/Versions/A/MySDK`
- `macos-x86_64/MySDK.framework/Versions/A/Resources/Info.plist`
- `macos-x86_64/MySDK.framework/Versions/Current/MySDK`
- `macos-x86_64/MySDK.framework/Versions/Current/Resources/Info.plist`
Then I create a new SPM project MyApp
with Package.swift
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "TestApp",
platforms: [.macOS(.v14), .iOS(.v13), .watchOS(.v6)],
products: [
.executable(name: "MyApp", targets: ["MyApp"])
],
targets: [
.executableTarget(name: "MyApp",
dependencies: [
.target(name: "MyFramework")
]
),
.binaryTarget(
name: "MyFramework",
path: "../test_sdk/MyFramework.xcframework"
)
]
)
And Sources/MyApp/main.swift:
import MySDK
print("Hello World: \(myHelloStr())")
$ swift run
Building for debugging...
error: emit-module command failed with exit code 1 (use -v to see invocation)
/Users/olivier/dev/test_app/Sources/MyApp/main.swift:1:8: error: no such module 'MySDK'
import MySDK
^
/Users/olivier/dev/test_app/Sources/MyApp/main.swift:1:8: error: no such module 'MySDK'
import MySDK
^
error: fatalError
If I generate my XCFramework using xcodebuild archive instead of xcodebuild build such as described in this doc https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle:
$ xcodebuild archive -scheme MySDK -destination "platform=macOS" -derivedDataPath DerivedData -archivePath "archives/MyFramework" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
(...)
** ARCHIVE SUCCEEDED **
$ xcodebuild -create-xcframework -archive archives/MyFramework.xcarchive -framework MySDK.framework -output MyFramework.xcframework
error: the path does not point to a valid framework: /Users/olivier/dev/test_sdk/archives/MyFramework.xcarchive/Products/Library/Frameworks/MySDK.framework
... it's not normal because I have these paths in /Users/olivier/dev/test_sdk/archives/MyFramework.xcarchive/Products:
/Users/olivier/dev/test_sdk/archives/MyFramework.xcarchive/Products/Users/olivier/Objects/MySDK.o
/Users/olivier/dev/test_sdk/archives/MyFramework.xcarchive/Products/usr/local/lib/MySDK.framework/...
XCode version
$ xcodebuild -version
Xcode 15.2
Build version 15C500b
The application often crashes and I register an error in the log, see attachment, but I can't figure out where the problem might be.
Eureka.Section.subscript.getter (Swift.Int) Eureka.BaseRow.txt
Thank you very much for the advice
Wondering if anyone else is running into this.
It seems ModelConfiguration(isStoredInMemoryOnly: true) for previews (as outlined by Paul Hudson / Hacking with Swift) works correctly for
iOS + iCloud syncing
macOS WITHOUT iCloud syncing
But as soon as I turn on iCloud syncing capability for my macOS target, its as if the isStoredInMemoryOnly has no effect on the macOS target.
Here's my code...
I made a PreviewHelper to encapsulate the preview logic...
enum PreviewHelper {
static let previewModelContainer: ModelContainer = {
do {
let config = ModelConfiguration(isStoredInMemoryOnly: true)
let container = try ModelContainer(for: Task.self, configurations: config)
return container
} catch {
fatalError("Failed to create model container for previewing: \(error.localizedDescription)")
}
}()
}
And then use it like so...
#Preview {
let container = PreviewHelper.previewModelContainer
for task in MockData.tasks {
container.mainContext.insert(task)
}
return HorizonView()
.modelContainer(container)
}
On the macOS target & destination, using a macOS device in the Preview canvas, with iCloud syncing turned on that code inserts the MockData.tasks into my iCloud container every time the preview refreshes, so the data just keeps getting duplicated. With iCloud syncing turned off it behaves as expected/correctly (just inserting the MockData as needed for Previews).
In an iOS target, using the same helper and mock data, the helper behaves as expected/correctly (with or without iCloud syncing enabled).
Assuming this might be a bug/oversight with SwiftData and macOS? Or am I missing a needed configuration/capability on the macOS side? Anybody else seeing this?
hello
We are currently developing using Healthkit.
Starting with xcode15, healthkit throws an error.
The code causing the error is HKQuantityType(.stepCount).
When I use this code
An EXC_BAD_ACCESS (code=1, address=0x0) error occurs.
The error is:
AppDelegate
It also appears when I call didFinishLaunchingWithOptions.
Is the linker the problem?
Or is the Swift version the problem?
Or HealthKit?
Cleaning and initializing DerivedData
I also tried downgrading DriverKit 22.4, but the error still appears.
Please tell me how to solve this problem.
Test model information is as follows:
-iPhone 14 Pro
iOS 16.5.1
Hi,
Just a quick one. I am working with a client who doesn't share his team's credentials like certificates, mobile provisioning, etc. He even refused to add me as one of the developer in his Apple Dev account. So, I am creating a new scheme for me that will use my own personal team and app ID to build it. While the main app's original scheme is basically unusable since I don't have the credentials to build it. The client still needs it for his CI/CD though.
Now, the app has a Notification Service extension that will share UserDefaults via App Group. When I try to create a container with the same group ID as his, it always failed. It seems like we can't use it because it has already been taken by the clent. How do I fix this so I can just change the scheme to switch between the client's and mine?
Thanks.
How to disable iOS Shortcut ( Automation ) Programmatically ?
I have made an automation to open my app whenever a user opens Facebook app. When the user taps on "Continue with Facebook" the automation which is forcing to open my App show be disabled for 2 minutes. How can I achieve this?
I have some Swift classes in my project that extend an Objective-C base class, which in turn extends NSObject. I did this years ago when Swift was new in order to take advantage of some Objective-C code that was difficult to rewrite in Swift. It's not a common situation but it has been working fine for a long time.
One of these classes is used as the key to a Dictionary and thus needs to be Hashable. The way I did this was to implement an == function and override the 'hash' property. It is a very simple case where the identity of the object is based on a single integer:
static func == (lhs: FishModel, rhs: FishModel) -> Bool {
return lhs.fishId == rhs.fishId
}
override var hash: Int {
return fishId
}
I believe that I initially tried to add "Hashable" to the class definition but was told it was redundant. I'm not sure why that is, but it worked fine without it.
Today I took the latest Xcode update to 15.2, and now my project won't compile anymore. The compiler error says that my class "does not conform to protocol Hashable". Adding Hashable to the class definition did not fix it. There are also some unusual errors about missing files, such as abi.json, swiftdoc, swiftmodule, and swiftsourceinfo.
Was this caused by the Xcode update? How do I fix it?
I am playing immersive video as shown in picture but it displays black screen until videos get loaded
and here is when video gets loaded
here is code snippet
struct ImmersiveMeditationPlayerView: View {
@Environment(\.dismissImmersiveSpace) private var dismissImmersiveSpace
@Environment(\.openWindow) private var openWindow
let player = AVPlayer()
init() {
Logger.shared.log(message: "IMERSIVE VIEW INSIDE")
}
var body: some View {
VStack {
RealityView { content, attachments in
//Create Entity for the video
let videoEntity = Entity()
let url = URL(string: "https://videoc2CIarRqKp")!
let asset = AVURLAsset(url: url)
let playerItem = AVPlayerItem(asset: asset)
//create a videoMaterial
let material = VideoMaterial(avPlayer: player)
//Made a Sphere with the videoEntity and asign the videoMaterial to it
videoEntity.components.set(ModelComponent(mesh: .generateSphere(radius: 1E3), materials: [material]))
//adjust the properties of the videoEntity(Sphere) if needed
videoEntity.scale = .init(x: 1, y: 1, z: -1)
videoEntity.transform.translation += SIMD3<Float>(0.0, 10.0, 0.0)
let angle = Angle.degrees(90)
let rotation = simd_quatf(angle: Float(angle.radians), axis: .init(x: 0, y: 0, z: 0))
videoEntity.transform.rotation = rotation
//add VideoEntity to realityView
content.add(videoEntity)
//start the VideoPlayer
player.replaceCurrentItem(with: playerItem)
player.play()
}
attachments: {
Attachment(id: "myMeditationBuilderView") {
}
}
}
Hi everyone :)
I'm exploring XPC these days; more specifically, I'm trying to establish a connection between a macOS application and an XPC service.
I succeeded in establishing the connection, but now I'm trying to verify the incoming connection by using SecCodeCopyGuestWithAttributes, passing it an audit token.
But I got the following error:
2024-01-18 10:43:06.805435+0100 DemoService[1627:7118397] [logging-persist] cannot open file at line 46922 of [554764a6e7]
2024-01-18 10:43:06.805452+0100 DemoService[1627:7118397] [logging-persist] os_unix.c:46922: (0) open(/private/var/db/DetachedSignatures) - Undefined error: 0
Cannot get SecCode: 100001 - UNIX[Operation not permitted]
Audit token: Optional(32 bytes)
The last two lines come from my code:
class XPCClientValidator {
var secCodeOptional: SecCode? = nil;
func identifyGuest(for connection: NSXPCConnection) -> Bool {
let auditToken = AuditToken.extractToken(from: connection)
let hostSecCode: SecCode? = nil; // This is a way to indicate that the code signing root of trust hould be used as host.
let attributes = [ kSecGuestAttributeAudit: auditToken ] as CFDictionary
let secFlags = SecCSFlags(rawValue: 0)
// Asks a code host to identify the guest given the audit token
let status: OSStatus = SecCodeCopyGuestWithAttributes(hostSecCode, attributes, secFlags, &self.secCodeOptional)
if (status != errSecSuccess) {
let msg = SecCopyErrorMessageString(status, nil)!
print("Cannot get SecCode: \(status) - \(msg)")
print("Audit token: \(String(describing: auditToken))")
return false
}
guard let _ = secCodeOptional else {
NSLog("Couldn't unwrap the secCode")
return false
}
return true
}
}
I saw a few posts on the forum, but nothing helped me to solve this issue.
The complete source code is here: https://github.com/tony-go/XPCDemo/tree/secure-xpc
Note: If you want to reproduce it, you have to:
start the app
type a random input
click on "uppercase it"
Suppose I have the following function:
func doWork(_ someValue: Int, completionHandler: () -> Void) {
let q = DispatchQueue()
q.async {
// Long time of work
completionHandler()
}
}
How do I turn it into async function so that I can call it using await doWork()? Are there guidelines/principles/practices for this purpose?
Hi folks,
For accessing the logs, I’m using OSLogStore object. I want to be able to read logs from any previous run of my application.
I can of course do this:
// Open the log store.
var logStore = try OSLogStore(scope: .currentProcessIdentifier)
But this only allows me to retrieve logs from my current running process.
I can also do this:
// Open the log store.
var logStore = try OSLogStore(scope: .system)
But this only works if my App Sandbox entitlement is false.
I tried disabling the sandbox, and I was able to get to all the logs (which is good) but according to this page:
https://developer.apple.com/documentation/security/app_sandbox/
it says:
To distribute a macOS app through the Mac App Store, you must enable the App Sandbox capability
Since we are planning on distributing our app on the store, this presents a big problem for me.
(I didn't try submitting to TestFlight to see if it's really the case). I don’t know if there are exclusions or ways around this – I don’t see an entitlement that I can add which would allow access to the logs.
Does anyone know a way around this?
Thanks,
David
Hey guys!
I'm building an app which detects cars via Vision and then retrieves the distance to said car by a synchronized depthDataMap. However, I'm having trouble finding the correct corresponding pixel in that depthDataMap. While the CGRect of the ObjectObservation ranges from 0 - 300 (x) and 0 - 600 (y), The width x height of the DepthDataMap is Only 320 x 180, so I can't get the right corresponding pixel. Any Idea on how to solve this?
Kind regards
Swift loop execution time is 20x slower when adding print statement that is executed once at the end
My Swift app iterates over two Array<String> and compares their elements.
Something very strange is going on. I have the impression the compiler is doing some optimizations that I cannot understand: commenting out the print statement in MyInterface.run() improves the runtime from about 10 seconds to below 0.5 seconds, and that print statement is executed only once at the end of the program. Even commenting out the if above it has the same effect.
I'm running the app in Xcode Instruments. When debugging it in Xcode, there is no difference when commenting out any of those two lines.
Instruments shows that most of the time is spent in protocol witness for Collection.subscript.read in conformance [A], Array.subscript.read and similar, which in turn call different malloc, initialize, free and release methods.
What's the problem with this code?
import Cocoa
@main
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
let x = Array(repeating: "adsf", count: 100000)
let y = Array(repeating: "adsf", count: 100000)
let diff = MyInterface(x: x, y: y)
diff.run()
}
}
class MyInterface<List: RandomAccessCollection & MutableCollection> where List.Element: Comparable, List.Index == Int {
private let algorithm: Algorithm<List>
init(x: List, y: List) {
algorithm = AlgorithmSubclass(x: x, y: y)
}
func run() {
algorithm.run()
if (0..<1).randomElement() == 0 {
print(algorithm.x.count) // commenting out this line, or the if above, makes the program 20x faster
}
}
}
class Algorithm<List: RandomAccessCollection> where List.Element: Equatable, List.Index == Int {
var x: List
var y: List
init(x: List, y: List) {
self.x = x
self.y = y
}
func run() {
}
}
class AlgorithmSubclass<List: RandomAccessCollection>: Algorithm<List> where List.Element: Equatable, List.Index == Int {
override func run() {
var count = 0
for _ in 0..<1000 {
for i in 0..<min(x.endIndex, y.endIndex) {
if x[i] == y[i] {
count += 1
}
}
}
let alert = NSAlert()
alert.messageText = "\(count)"
alert.runModal()
}
}
I have a project that has Cpp code and swift code and I m making some calls from swift to cpp. For this I m using the Cpp-swift interop mechanism introduced in swift 5.9 for making direct calls between swift and cpp.
I m using module.modulemap file to expose the cpp code to swift. I am facnig an error when I try to access a cpp header that are using the cpp compiler flags in some static assert statements. These methods are working fine in cpp however, when I try to access these methods from swift using the modulemap file, the compiler flags are not being identified by swift, and produces the below error
error: use of undeclared identifier 'TW_KERNEL_WINDOWS'.
This is my module.modulemap file:
module CoreModule {
header "ProcessStates.hpp" //cpp header that contains compiler flags
export *
}
below is the cpp header code that I m trying to access in swift:
#pragma once
// if the given condition is false – treat as an error
#define STATIC_CHECKFALSE(condition, message) static_assert (condition, message)
STATIC_CHECKFALSE ((TW_KERNEL_WINDOWS == 0) || (TW_KERNEL_WINDOWS == 1), "TW_KERNEL_WINDOWS can only be 0 or 1");
Can someone help, why is this happening and how to resolve this?
I'm developing an iOS app (latest Swift, iOS, Xcode versions atm of writing) which needs to rename audio files (and later modify its metadata) located anywhere (local storage, external storage, cloud, etc). I'm bringing my own question in StackOverflow but I'd like to know better from the source so I came here.
The trouble comes when testing on a physical device while trying to rename a file in some folder On My iPhone, the app does as intended when testing on the Simulator. On my physical iPhone I get an error logged saying that I don't have the permissions to do that.
“filename.mp3” couldn’t be moved because you don’t have permission to access “randomFolder".
I did my googling and asked GPTs about it, learned about FileCoordinator, UIDocumentPickerViewController, startAccessingSecurityScopedResource. I also saw a couple of videos that I cannot reference in this forum.
Some code I have in place:
This is the document picker which I then call from a .sheet on another View.
struct DocumentPicker: UIViewControllerRepresentable {
@Binding var newName: String
@EnvironmentObject private var bookmarkController: BookmarkController
func makeUIViewController(context: Context) -> UIDocumentPickerViewController {
let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: supportedTypes)
documentPicker.delegate = context.coordinator
return documentPicker
}
func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: Context) {
print("updateUIViewController documentPicker")
}
func makeCoordinator() -> Coordinator {
Coordinator(self, newName)
}
class Coordinator: NSObject, UIDocumentPickerDelegate {
var parent: DocumentPicker
var newName: String
init(_ parent: DocumentPicker, _ newName: String = "") {
self.parent = parent
self.newName = newName
}
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
// save bookmark
print("documentPicker \(urls[0])")
parent.bookmarkController.addBookmark(for: urls[0])
// Rename the file
var error: NSError?
NSFileCoordinator().coordinate(readingItemAt: urls[0], options: [], error: &error) { coordinatedURL in
do {
// let data = try Data(contentsOf: newURL)
print("urls[0]: \(urls[0])")
print("coordinatedURL: \(coordinatedURL)")
print("renamedURL: \(newName)")
try renameFile(at: coordinatedURL, to: newName)
} catch {
print("Error: \(error.localizedDescription)")
}
}
}
}
}
Renaming function:
/// Rename selected file from browser
func renameFile(at fileURL: URL, to newName: String) throws {
let fileExtension = fileURL.pathExtension
let directory = fileURL.deletingLastPathComponent()
// Create a new URL with the updated name and the original extension
let renamedURL = directory.appendingPathComponent(newName).appendingPathExtension(fileExtension)
try FileManager.default.moveItem(at: fileURL, to: renamedURL)
}
I have a BookmarkController in place so that my URLs are bookmarked for later use. Here it is:
import SwiftUI
import MobileCoreServices
class BookmarkController: ObservableObject {
@Published var urls: [URL] = []
init() {
loadAllBookmarks()
}
func addBookmark(for url: URL) {
print("adding bookmark for \(url)")
do {
guard url.startAccessingSecurityScopedResource() else {
print("Failed to obtain access to the security-scoped resource.")
return
}
defer { url.stopAccessingSecurityScopedResource() }
let bookmarkData = try url.bookmarkData(options: .minimalBookmark, includingResourceValuesForKeys: nil)
let uuid = UUID().uuidString
try bookmarkData.write(to: getAppSandboxDir().appendingPathComponent(uuid))
urls.append(url)
} catch {
print("Error Adding Bookmark: \(error.localizedDescription)")
}
}
func loadAllBookmarks() {
// Get all the bookmark files
let files = try? FileManager.default.contentsOfDirectory(at: getAppSandboxDir(), includingPropertiesForKeys: nil)
// Map over the bookmark files
self.urls = files?.compactMap { file in
do {
let bookmarkData = try Data(contentsOf: file)
var isStale = false
// Get the URL from each bookmark
let url = try URL(resolvingBookmarkData: bookmarkData, bookmarkDataIsStale: &isStale)
guard !isStale else {
// Handle stale bookmarks
return nil
}
print("loaded bookmark: \(url)")
// Return URL
return url
} catch {
print("Error Loading Bookmark: \(error.localizedDescription)")
return nil
}
} ?? []
}
private func getAppSandboxDir() -> URL {
// TODO ver 0 index
FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
}
}
When running on my device, I see url.startAccessingSecurityScopedResource throwing:
Failed to obtain access to the security-scoped resource.
I have also tried getting access to the parent directory like this:
let parentURL = url.deletingLastPathComponent()
and then using parentURL instead, but it also fails.
Something I noticed is that my app is not shown in the Settings -> Privacy & Security -> Files and Folders list. My app didn't trigger any dialog to be added here given user consent.
Fiddling with entitlements in Info.plist and Capabilities did not help either, but I'm not so sure about which ones should I add.
So:
Could it be that the problem I'm seeing about permissions and my app not appearing at the Files and Folders privacy settings on my iPhone are because my app is signed with a developer account which is not in the apple developer program? this is my last thought since I'm not understanding what else should I try.
Any pointers and help will be much appreciated.
Thanks!
Is there any way to get an unnamed property of a tuple given its position?
Like below:
let record = ("field1", "field2")
func getRecordFieldValue(at: Int, of record: (String, String)) -> Any? {
// pseudo code
record.[at]
}
Hello. I have three questions about the Sensitive Content Analysis (SCA) framework:
SCA seems to be asynchronous. Is there a limit to how much a single app can send through it at a time?
For video analysis, can the video be broken into smaller chunks, and then all chunks be hit concurrently?
Can a video stream be sampled as it's being streamed? e.g. Maybe it samples one frame every 3 seconds and scans those?
Thanks.
How do I change just the starting point of an existing UIBezierPath? .. and leave all other points the same?
I have definitely seen many posts on how to do this .. honestly, I just do not understand many of them
My existing path has one .move(to:) and many .addLine(to:)
My goal is:
(1) replace the .move(to:) with .addLine(to:) and then
(2) change one of the .addLine(to:) with .move(to:)
All other CGPoints stay the same.
In order to get the new starting point, I set:
savedPathPoint = myPath.currentPoint
when I stop the following motion.
At some point, I want to resume this following motion with the new starting point = savedPathPoint via
myPath.move(to: savedPathPoint)
let myAction = SKAction.follow(
myPath.cgPath,
asOffset: false,
orientToPath: true,
duration: 0.1)
mySprite.run(myAction)
When I look at the above problem description, it really appears simple.
Nevertheless, its implementation alludes me.
Thanks bunches in advance for any hints whatsoever.
Hello everyone!
I'm quite new to App development (but have quite a bit of programming experience).
I have reached the point where I would like to Archive my app for release but I'm stumped at an issue where the app compiles, builds and runs just fine in XCode on device and simulator targets however fails when I want to archive the app.
My app ends up using a mix of a lot of things possible:
Swift and SwiftUI
Obj-C and some vanilla C, mainly because I use a framework in C
Very minimal but some UIKit (that bridges with some parts in C)
Here is the stacktrace, would appreciate some insights
1. Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
2. Compiling with the current language version
3. While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for CamHero)
4. While running pass #12497 SILModuleTransform "PerformanceSILLinker".
5. While deserializing SIL function "$s7SwiftUI11EnvironmentV12wrappedValuexvg"
6. While deserializing SIL function "os_log_type_enabled"
7. *** DESERIALIZATION FAILURE ***
*** If any module named here was modified in the SDK, please delete the ***
*** new swiftmodule files from the SDK and keep only swiftinterfaces. ***
module 'SwiftUI', builder version '5.9.2(5.9.2)/Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)', built from swiftinterface, resilient, loaded from '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/prebuilt-modules/17.2/SwiftUI.swiftmodule/arm64-apple-ios.swiftmodule'
result not found (isEnabled)
Cross-reference to module 'os'
... OSLog
... in an extension in module 'os'
... isEnabled
... with type (OSLog) -&gt; (OSLogType) -&gt; Bool
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 swift-frontend 0x0000000103a11abc llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) + 56
1 swift-frontend 0x0000000106677cb0 llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x00000001063e1054 SignalHandler(int) + 352
3 libsystem_platform.dylib 0x00000001895b3a24 _sigtramp + 56
4 libsystem_pthread.dylib 0x0000000189584cc0 pthread_kill + 288
5 libsystem_c.dylib 0x0000000189494a40 abort + 180
6 swift-frontend 0x0000000102bd7c2c (anonymous namespace)::ParsedAttrInfoFallThrough::~ParsedAttrInfoFallThrough() + 0
7 swift-frontend 0x0000000104470db8 std::__1::__function::__func&lt;swift::evaluator::PerRequestReferences swift::evaluator::PerRequestReferences::makeEmpty&lt;swift::LookupPrefixOperatorRequest&gt;()::'lambda'(void*), std::__1::allocator&lt;swift::evaluator::PerRequestReferences swift::evaluator::PerRequestReferences::makeEmpty&lt;swift::LookupPrefixOperatorRequest&gt;()::'lambda'(void*)&gt;, void (void*)&gt;::operator()(void*&amp;&amp;) + 0
8 swift-frontend 0x0000000102b2c534 swift::ModuleFile::fatal(llvm::Error) const + 44
9 swift-frontend 0x00000001044721dc swift::CyclicalRequestError&lt;swift::LookupPrefixOperatorRequest&gt;::~CyclicalRequestError() + 0
10 swift-frontend 0x00000001045bb880 swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt&lt;unsigned int, 31&gt;, swift::SILFunction*, llvm::StringRef, bool, bool) + 1588
11 swift-frontend 0x0000000102bb0f50 swift::SILDeserializer::getFuncForReference(llvm::StringRef, swift::SILType) + 504
12 swift-frontend 0x00000001045cb578 swift::SILDeserializer::readSILInstruction(swift::SILFunction*, swift::SILBuilder&amp;, unsigned int, llvm::SmallVectorImpl&lt;unsigned long long&gt;&amp;) + 29524
13 swift-frontend 0x00000001045bc554 swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt&lt;unsigned int, 31&gt;, swift::SILFunction*, llvm::StringRef, bool, bool) + 4872
14 swift-frontend 0x00000001045d6934 swift::SILDeserializer::lookupSILFunction(swift::SILFunction*, bool) + 636
15 swift-frontend 0x0000000102c4d990 swift::SILLinkerVisitor::deserializeAndPushToWorklist(swift::SILFunction*) + 88
16 swift-frontend 0x0000000102c4dfb0 swift::SILLinkerVisitor::processFunction(swift::SILFunction*) + 248
17 swift-frontend 0x0000000103c60fa4 (anonymous namespace)::SILLinker::run() (.llvm.15023899450236721039) + 136
18 swift-frontend 0x0000000106018874 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&amp;) + 16276
19 swift-frontend 0x00000001061c21c4 swift::SimpleRequest&lt;swift::ExecuteSILPipelineRequest, std::__1::tuple&lt;&gt; (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1&gt;::evaluateRequest(swift::ExecuteSILPipelineRequest const&amp;, swift::Evaluator&amp;) + 56
20 swift-frontend 0x00000001060646b8 llvm::Expected&lt;swift::ExecuteSILPipelineRequest::OutputType&gt; swift::Evaluator::getResultUncached&lt;swift::ExecuteSILPipelineRequest&gt;(swift::ExecuteSILPipelineRequest const&amp;) + 476
21 swift-frontend 0x000000010607c424 swift::runSILOptimizationPasses(swift::SILModule&amp;) + 472
22 swift-frontend 0x000000010400c3c0 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 572
23 swift-frontend 0x0000000105f59454 performCompileStepsPostSILGen(swift::CompilerInstance&amp;, std::__1::unique_ptr&lt;swift::SILModule, std::__1::default_delete&lt;swift::SILModule&gt;&gt;, llvm::PointerUnion&lt;swift::ModuleDecl*, swift::SourceFile*&gt;, swift::PrimarySpecificPaths const&amp;, int&amp;, swift::FrontendObserver*) + 956
24 swift-frontend 0x0000000105f54f00 performCompile(swift::CompilerInstance&amp;, int&amp;, swift::FrontendObserver*) + 3020
25 swift-frontend 0x0000000105f58854 swift::performFrontend(llvm::ArrayRef&lt;char const*&gt;, char const*, void*, swift::FrontendObserver*) + 4568
26 swift-frontend 0x0000000105fbfd44 swift::mainEntry(int, char const**) + 4408
27 dyld 0x00000001892090e0 start + 2360
Command SwiftCompile failed with a nonzero exit code