Starting with Xcode 15 and later, Apple introduced visionOS support, and some React Native libraries (including react-native-safe-area-context) have updated their podspecs to include visionos as a target platform. However, if your CocoaPods version, Expo SDK, or Xcode setup is outdated or misconfigured, it may not recognize this method, leading to the error. As your question is not having much details I can suggest you to do these and try.
Update Expo CLI and SDK
Update CocoaPods