Xcode 16 build fail issue - method does not override method from its superclass

When overriding the following seek functions in a custom subclass of AVPlayerItem, a "method does not override method from its superclass" error occurs, causing the build to fail. This issue only happens after updating to Xcode 16. Do you have any suggestions on how to fix it?

https://developer.apple.com/documentation/avfoundation/avplayeritem/seek(to:completionhandler:)-91gnw

https://developer.apple.com/documentation/avfoundation/avplayeritem/seek(to:tolerancebefore:toleranceafter:completionhandler:)

(This error disappears 3 seconds after the build fails or temporarily disappears when the function's position in the file is changed.)

I have a similar problem in a custom subclass of UIApplication

MyApplication.swift:37:21: error: method does not override any method from its superclass

open override func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: (@MainActor @Sendable (Bool) -> Void)? = nil) {


UIKit.UIApplication:24:26: note: potential overridden instance method 'open(_:options:completionHandler:)' here
 
@MainActor open func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: (@Sendable (Bool) -> Void)? = nil)

I'm also replicating it with Xcode 16.

I am getting the same error for AVPlayer.seek() method.

What works for me is:

  1. Use Xcode 16.3 (there is no error there)

or on Xcode < 16.3

  1. Set Compilation Mode to Whole Module in Build Settings. By default it is Incremental for Debug builds
Xcode 16 build fail issue - method does not override method from its superclass
 
 
Q