I also have SE2 and constantly get various errors while debugging watchOS apps with Xcode. Connection is very unstable.
Post
Replies
Boosts
Views
Activity
Similar issue:
// Sending 'center' risks causing data races
let granted = try await center.requestAuthorization(options: options)
Silenced by using @preconcurrency:
@preconcurrency import UserNotifications
I was able to resolve the issue by switching to URL Schema. The tricky part here, is that the schema should contain at least some path components. First I tried schemes like this:
myapp-halloween://
And got the error when tried to save the Custom Product Page:
⚠️Your changes could not be saved. Try again later
Initially it was unclear at all what's wrong here. I thought that maybe URL Schemes are not acceptable at all, so that's why we tried deeplinks. And got the similar error as OP: on the first attempt deeplink isn't activated even on iOS 18.2.1.
But experementally I found that if you add some path components, like:
myapp://halloween
Then everything works fine. CPP submitted without issues and the scheme opens the app and the URL gets received.
I had the same issue, @SpaceGrey. You solved it by using "All Sizes", I solved it by staying at "Single Size" but replacing JPG with PNG.
@iphonegamedeveloper, any success? I guess if scheme isn't https or http that we can assume it's custom in most cases.
We ended up switching to another backend provider 😢 But I hope one day we will return to CloudKit, as it maturates and gets better.
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.
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.
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.
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
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.