@CruncyBagel Hm yeah, my .intentsdefinition file is already part of the main app target. But I think the issue is related to something like that. I will keep investigating.
Post
Replies
Boosts
Views
Activity
Oops, I accidentally marked my response as the answer. It's not. 🥴
Okay, after some more digging I found out what the error was. Since I'm integrating this into an app that already has intent support, I had forgotten to deal with my new intent handler in the INExtension subclass.
So, the solution was this:
class IntentHandler: INExtension {
		override func handler(for intent: INIntent) -> Any? {
				if intent is SomeIntent {
						return SomeHandler()
				}
				if intent is SomeOtherIntent {
						return SomeOtherIntentHandler()
				}
				// NOTE: this is what I had forgotten to add
				if #available(iOS 14, *), intent is WidgetIntent {
						return WidgetIntentHandler()
				}
				return nil
		}
}
I think I encountered the same issue today using Xcode 13.3 and iOS 15.4, and from what I can see the issue still persists. The following code reproduces the problem I'm having:
struct ContentView: View {
var body: some View {
ScrollViewReader { proxy in
ScrollView {
Spacer(minLength: 300)
Button("Scroll to #50") {
proxy.scrollTo(50, anchor: .center)
}
VStack(spacing: 0) {
ForEach(0..<100) { i in
Text("\(i)")
.frame(height: 100)
.id(i)
.frame(maxWidth: .infinity)
}
}
}
}
}
}
I submitted a feedback to Apple using the above code sample: FB9959257.
This has been happening to me as well. My builds have jumped from around 9 minutes, to around 17-20 minutes, so about a 2x increase in build times. I'm using the free tier of Xcode Cloud though, so I feel like I can't quite complain about it.
FWIW, I was experiencing the same phenomenon (crashes related to multi threading issues) in a few other places:
LAContext.evaluatePolicy(_:localizedReason:reply:)
UNUserNotificationCenter.getNotificationSettings(completionHandler:)
UNUserNotificationCenter.add(_:withCompletionHandler:)
In all of these cases, the workaround suggested by Quinn did the trick of avoiding the crash.
Best Regards,
Viktor