Is AVPlayerViewController not supported on macCatalyst?

When building an application that can be built on iOS using macCatalyst, a link error like the one below will occur.

Undefined symbol: OBJC_CLASS$_AVPlayerViewController

The AVPlayerViewController documentation seems to support macCatalyst, but what is the reality? [AVPlayerViewController](https://developer.apple.com/documentation/avkit/avplayerviewcontroller? language=objc)

Each version of the environment is as follows.

  • Xcode 16.2
  • macOS deployment target: macOS 10.15
  • iOS deployment target: iOS 13.0

Thank you for your support.

Answered by hnd-rh in 826470022

As a supplement, AVKit.framework is included in the link target.

Accepted Answer

As a supplement, AVKit.framework is included in the link target.

Hello @hnd-rh, thank you for your post. Yes, AVPlayerViewController is supported on Mac Catalyst. Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Thank you for your reply.

I have uploaded a minimal project with similar issue below.

https://github.com/honma-r/AVPlayerViewControllerTest

After doing some research, I found that the build passed by removing the following set in 'Framework Search Path' in 'Build Settings', but since I am using CMake I am unable to remove the above settings. Also, it seems that there is no problem with the above settings itself, but is it possible to avoid this problem in some way?

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/iOSSupport/System/Library/Frameworks

Respectfully,

Is AVPlayerViewController not supported on macCatalyst?
 
 
Q