twilio / twilio-video-ios

Programmable Video SDK by Twilio
http://twilio.com/video
Other
66 stars 22 forks source link

Public protocols rely on AVFoundation type deprecated in iOS 17.0 #273

Open patrickhartling opened 4 months ago

patrickhartling commented 4 months ago

Description

If a consumer of the framework has their deployment target set to iOS 17.0 or newer, the Swift compiler will report deprecation warnings from TVICameraSourceOrientationTracker.h. These are associated with AVCaptureVideoOrientation being deprecated in iOS 17.0 and newer.

The warnings look like the following when using TwilioVideo with Swift Package Manager:

/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphoneos/TwilioVideo.framework/Headers/TVICameraSourceOrientationTracker.h:28:38 'AVCaptureVideoOrientation' is deprecated: first deprecated in iOS 17.0 - Use AVCaptureDeviceRotationCoordinator instead

'AVCaptureVideoOrientation' has been explicitly marked deprecated here
In file included from <module-includes>:1:
In file included from /.../Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphoneos/TwilioVideo.framework/Headers/TwilioVideo.h:22:

/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphoneos/TwilioVideo.framework/Headers/TVICameraSourceOrientationTracker.h:51:41 'AVCaptureVideoOrientation' is deprecated: first deprecated in iOS 17.0 - Use AVCaptureDeviceRotationCoordinator instead

'AVCaptureVideoOrientation' has been explicitly marked deprecated here
In file included from <module-includes>:1:
In file included from /.../Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphoneos/TwilioVideo.framework/Headers/TwilioVideo.h:22:

/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphoneos/TwilioVideo.framework/Headers/TVICameraSourceOrientationTracker.h:71:41 'AVCaptureVideoOrientation' is deprecated: first deprecated in iOS 17.0 - Use AVCaptureDeviceRotationCoordinator instead

'AVCaptureVideoOrientation' has been explicitly marked deprecated here

More specifically, the warnings are associated with the following public protocols:

Steps to Reproduce

  1. Open the Xcode project (attached below as TwilioTest.zip) in Xcode 15.
  2. Build the project.

Code

TwilioTest.zip

Expected Behavior

I would not expect the Swift compiler to emit deprecation warning from a dependency, particularly when the dependency has a deployment target set wherein the deprecation warning does not apply. However, that is not how things work today with Swift.

Actual Behavior

The warnings shown above are reported and cannot be addressed by the user of the framework. Any implementation of one of the protocols involved will also result in deprecation warnings being reported.

Reproduces How Often

Always.

Logs

N/A

Versions

macOS Sonoma 14.5

Video iOS SDK

5.5.0 through 5.8.2 via Swift Package Manager

Xcode

iOS Version

17.0 and newer

iOS Device

Any

diederikh commented 1 month ago

Same issue here. Seems to be related to enabling Explicitly built Modules build setting.