I can attest that AVCaptureDevice.requestAccess suffered from this same problem, i.e. crashing with a thread/queue violation when built under Swift 6.
Original code:
AVCaptureDevice.requestAccess(for: AVMediaType.video, completionHandler: { granted in
if (granted)
{
DispatchQueue.main.async { [weak self] in
// do something
}
}
})
Modified code:
Task {
let granted = await AVCaptureDevice.requestAccess(for: .video)
if (granted) {
Task { @MainActor in
// do something
}
}
}
This code pops a permission dialog for using the camera, and as soon as the Allow button is clicked the app would crash.
Post
Replies
Boosts
Views
Activity
Please disregard my question, further research indicates that Array parameters are supported ... I just need to figure out why my implementation isn't working...
SOLVED. I was able to resolve this issue by changing build setting "Build Active Architecture Only" from No to Yes. Hope this helps anyone else that might run into this.
In my case I'm getting an Error not a warning, and the target is not built. I've also filed a bug report FB8116526. Thanks