react-native-video-processing
react-native-video-processing copied to clipboard
Swift 4.2 compiler errors
Current Behavior
When I migrate my Swift version to 4.2 and build the project, the compiler will report multiple compiling errors like:
path-to-my-project/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoPlayer.swift:37:23: 'AVLayerVideoGravityResizeAspect' has been renamed to 'AVLayerVideoGravity.resizeAspect'
path-to-my-project/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoPlayer.swift:121:91: 'kCMTimeZero' has been renamed to 'CMTime.zero'
I convert Swift to 4.2 using Edit > Convert > To Current Swift Syntax in XCode. It then gives me a list of targets to covert. Odd thing is, when I only choose my main project, it will result in this error. But if I choose all targets (all of them are node modules, therefore ignored by Git), the compiler will run smoothly.
Expected Behavior
The compiler should work without error when I upgrade Swift only in my main project to 4.2
Your Environment
software | version |
---|---|
react-native-video-processing | 1.20.0 |
react-native | 0.55.1 |
node | 8.12.0 |
XCode is giving us recommendation to upgrade Swift version to 4.2 and then we ran into this issue. Hope you guys could help me with this.
same problem :/
Swift already migrated to 4.2 at #216
I solved it by Changing the Swift Language to 3
@slavasemeniuk there are about 40 errors in 4.2 Swift. Such as :
- RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:22:59: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'. (/AVFoundation.AVMediaTypeVideo:3:12: 'AVMediaTypeVideo' was obsoleted in Swift 3)
- RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:44:66: 'AVFileTypeQuickTimeMovie' has been renamed to 'AVFileType.mov'. (/AVFoundation.AVFileTypeQuickTimeMovie:3:12: 'AVFileTypeQuickTimeMovie' was obsoleted in Swift 3) ....
Hope you guys could help me with this.
@slavasemeniuk there are about 40 errors in 4.2 Swift. Such as :
- RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:22:59: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'. (/AVFoundation.AVMediaTypeVideo:3:12: 'AVMediaTypeVideo' was obsoleted in Swift 3)
- RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:44:66: 'AVFileTypeQuickTimeMovie' has been renamed to 'AVFileType.mov'. (/AVFoundation.AVFileTypeQuickTimeMovie:3:12: 'AVFileTypeQuickTimeMovie' was obsoleted in Swift 3) ....
Hope you guys could help me with this.
I am having the same issue. Were you able to solve this?
@electricfeel1979 @Yhspehy #236
@slavasemeniuk there are about 40 errors in 4.2 Swift. Such as :
- RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:22:59: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'. (/AVFoundation.AVMediaTypeVideo:3:12: 'AVMediaTypeVideo' was obsoleted in Swift 3)
- RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:44:66: 'AVFileTypeQuickTimeMovie' has been renamed to 'AVFileType.mov'. (/AVFoundation.AVFileTypeQuickTimeMovie:3:12: 'AVFileTypeQuickTimeMovie' was obsoleted in Swift 3) ....
Hope you guys could help me with this.
@slavasemeniuk , @shahen94 I have same issue un RN 0.59.10 and swift 4 , 4.2 , 5
@shahen94 I see that you release latest version long time ago , I get #master branch and now I have 'zero' has been renamed to 'kCMTimeZero' error