You have to use Logger for that. It will output the messages to Console.app, as well as to Xcode console.
However, you have to specify them as public, otherwise the message text will be hidden. Like this:
import os.log
let logger = Logger(subsystem: "com.kelin.vladimir", category: "Debug")
// Log level: notice. Explicitly specified `public`.
logger.notice("\("TEST", privacy: .public)")
In order to protect your private data in prod, consider using #if DEBUG macro.
Post
Replies
Boosts
Views
Activity
Check that intentClassName corresponds to old Siri Intent auto-generated class name.
Declare your AppIntent struct as public.
Try marking the entire MyIntent struct as public. This advice worked for me.
One of GPTs suggested me to make App Intent declaration public. This actually worked.
To save your time I copy-pasted Michcio's answer from the SO link posted by @Claude31 above:
let imageAttachment = NSTextAttachment()
imageAttachment.image = UIImage(systemName: "checkmark.circle")
// If you want to enable Color in the SF Symbols.
imageAttachment.image = UIImage(systemName: "checkmark.circle")?.withTintColor(.blue)
let fullString = NSMutableAttributedString(string: "Press the ")
fullString.append(NSAttributedString(attachment: imageAttachment))
fullString.append(NSAttributedString(string: " button"))
label.attributedText = fullString
Guys, actually, I found an unexpected workaround! If you can isolate the view, that potentially crashes, try to extract it in a separate View file. Make a custom subview that uses the 3d party lib, that causing the crash. In my case it was ACarousel. Then, in the view that you actually need to preview, use this subview. If the 3d party lib isn't imported there, the preview will work. Fantastic! This cost me 6 hours of work.
The accepted answer is not an answer, but a comment. I have the similar issue with ACarousel preview.
LinkDylibError: Failed to build PaywallCarousel.swift
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This discussion is similar and have much more activity: https://forums.developer.apple.com/forums/thread/736152?page=2
I have the same issue with the view using ACarousel in Xcode version 15.3 (15E204a). Sorry Apple, I can't install Xcode 16 right now, I need everything to work predictable.
The preview stopped to work suddenly and nothing of the above fixes work.
Also, for some reason preview started to fail if XCTest fails to build.
Turns out this happened to many developers and happens from time to time. Some people solved it by following the button and downloading the SDK, but there's a faster solution: just reboot your Mac.
I had the exact same set of errors as @SpaceMan in my macOS app. Here the entire error stack:
Could not launch “CloudKitCMS”
Domain: IDELaunchErrorDomain
Code: 20
Recovery Suggestion: Runningboard has returned error 5. Please check the system logs for the underlying cause of the error.
--
Could not launch “CloudKitCMS”
Domain: IDELaunchErrorDomain
Code: 20
Recovery Suggestion: Runningboard has returned error 5. Please check the system logs for the underlying cause of the error.
--
The operation couldn’t be completed. Launch failed.
Domain: RBSRequestErrorDomain
Code: 5
Failure Reason: Launch failed.
--
Launchd job spawn failed
Domain: NSPOSIXErrorDomain
Code: 153
--
I tried editing apple id but without any success. I noticed that some people refer entitlements, so I inspected by CloudKitCMS.entitlements file and found that several keys there are totally irrelevant to the project:
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.applesignin</key>
<array>
<string></string>
</array>
<key>com.apple.developer.aps-environment</key>
<string>development</string>
So I completely removed the above keys and now it runs! I must note that my project doesn't use Push Notifications (aps-related keys) and I don't know how those keys got there, probably Xcode added them automatically.
So my recommendation would be to check the entitlements and remove everything that's not enabled for the bundle id.
From the docs:
CKErrorResultsTruncated.
An error that occurs when CloudKit truncates a query’s results.
Consider limiting query results count to CKQueryOperation.maximumResults constant.
I guess CloudKit also has usage limits, so it can truncate the response in case when the app makes too much requests, for example.
BTW error response really has misspelling: REALTIONSHIP. That's what I receive.
The problem here is that configurationDisplayName is provided by modifier, not by a property. Since it's a declarative style.
Further investigations. Extended memory growth happens inplaceholder(in:) func of a TimelineProvider. In getSnapshot(in:completion:) and getTimeline(in:completion:) memory doesn't grow. Maybe the key difference here is that placeholder(in:) is a syncrhonous function, while two others use completions. I suppose internal WidgetKit implementation runs a for loop through all the widgets and accumulates placeholder images array. Then writes it to disk and memory decreases.
I guess it works the same way as the app purchase usually refunded. User should contact Apple support and the Store will handle it for you. You'll see negative transaction in your analytics panel.