A solution for my case:
Xcode -> target
General -> Build settings -> under Mac catalyst deployment section, set Support mac catalyst to Yes.Build phases tab -> scroll down to section Link binary with libraries -> add AVKit.framework -> clean build folder and rebuild.