react-native-video-processing icon indicating copy to clipboard operation
react-native-video-processing copied to clipboard

Swift 4.2 compiler errors

Open thainx opened this issue 5 years ago • 8 comments

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.

thainx avatar Feb 13 '19 10:02 thainx

same problem :/

comy94 avatar May 01 '19 15:05 comy94

Swift already migrated to 4.2 at #216

slavasemeniuk avatar May 04 '19 14:05 slavasemeniuk

I solved it by Changing the Swift Language to 3

Mixpeal avatar May 21 '19 13:05 Mixpeal

@slavasemeniuk there are about 40 errors in 4.2 Swift. Such as :

  1. RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:22:59: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'. (/AVFoundation.AVMediaTypeVideo:3:12: 'AVMediaTypeVideo' was obsoleted in Swift 3)
  2. 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.

Yhspehy avatar Jun 13 '19 09:06 Yhspehy

@slavasemeniuk there are about 40 errors in 4.2 Swift. Such as :

  1. RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:22:59: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'. (/AVFoundation.AVMediaTypeVideo:3:12: 'AVMediaTypeVideo' was obsoleted in Swift 3)
  2. 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?

kevmmdev avatar Jul 22 '19 05:07 kevmmdev

@electricfeel1979 @Yhspehy #236

slavasemeniuk avatar Jul 22 '19 09:07 slavasemeniuk

@slavasemeniuk there are about 40 errors in 4.2 Swift. Such as :

  1. RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:22:59: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'. (/AVFoundation.AVMediaTypeVideo:3:12: 'AVMediaTypeVideo' was obsoleted in Swift 3)
  2. 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

sm2017 avatar Sep 24 '19 08:09 sm2017

@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

sm2017 avatar Sep 24 '19 08:09 sm2017