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

Not working in ios latest react native version swift 3 errors

Open sidpauhal opened this issue 4 years ago • 8 comments

Library is not working in fresh installed react native version Not even able to run project with react-native run-ios cmd

package.json file

"dependencies": {
    "@react-native-firebase/app": "^6.0.1",
    "@react-native-firebase/ml-vision": "^6.0.1",
    "react": "16.9.0",
    "react-native": "0.61.2",
    "react-native-image-picker": "^1.1.0",
    "react-native-video-processing": "^1.20.0"
  }

below is the errors looks like related to swift 3 Can you update the lib so it can be compatible with latest swift 4 or 5

/Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:22:59: error: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'
    guard let videoTrack = original.tracks(withMediaType: AVMediaTypeVideo).last else {
                                                          ^~~~~~~~~~~~~~~~
                                                          AVMediaType.video
AVFoundation.AVMediaTypeVideo:3:12: note: 'AVMediaTypeVideo' was obsoleted in Swift 3
public let AVMediaTypeVideo: AVMediaType
           ^
/Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:44:66: error: 'AVFileTypeQuickTimeMovie' has been renamed to 'AVFileType.mov'
      writer = try AVAssetWriter(outputURL: outputURL, fileType: AVFileTypeQuickTimeMovie)
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
                                                                 AVFileType.mov
AVFoundation.AVFileTypeQuickTimeMovie:3:12: note: 'AVFileTypeQuickTimeMovie' was obsoleted in Swift 3
public let AVFileTypeQuickTimeMovie: AVFileType
           ^
/Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:57:53: error: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'
    let writerInput = AVAssetWriterInput(mediaType: AVMediaTypeVideo, outputSettings: writerOutputSettings)
                                                    ^~~~~~~~~~~~~~~~
                                                    AVMediaType.video
AVFoundation.AVMediaTypeVideo:3:12: note: 'AVMediaTypeVideo' was obsoleted in Swift 3
public let AVMediaTypeVideo: AVMediaType
           ^


** BUILD FAILED **


The following build commands failed:
	CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoProcessingManager.swift
	CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoPlayer.swift
	CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNTrimmerView/RNTrimmerView.swift
	CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNTrimmerView/RNTrimmerViewManager.swift
	CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/RNVideoTrimmer.swift
	CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift
	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler

sidpauhal avatar Oct 18 '19 16:10 sidpauhal

@sidpauhal any solution for fix this problem ?

forkeer avatar Oct 20 '19 06:10 forkeer

@shahen94 hi can you recommend any solution?

sidpauhal avatar Oct 21 '19 05:10 sidpauhal

@sidpauhal Have you tried with the master version? Add this to your package.json

"react-native-video-processing": "git+https://[email protected]/shahen94/react-native-video-processing.git"

edferreira avatar Oct 21 '19 13:10 edferreira

@edferreira yes I have tried it is not working

sidpauhal avatar Oct 22 '19 15:10 sidpauhal

I fixed this issue by changing the function to the newest function name in my swift version by pressing the fix button in XCode :)

simenJohnsen avatar Oct 30 '19 08:10 simenJohnsen

Can we have this fixed in lib please? its breaking on the latest RN

enigmablue avatar Nov 13 '19 12:11 enigmablue

I am using 59.9 and If I set Swift version 4, 4.2 or 5 I get thousands of Swift errors.

Is this package without maintenance?

lucastonon avatar Nov 20 '19 20:11 lucastonon

@lucastonon This package is under maintenance by the community. So everyone is free to fork & update & open PR to merge

shahen94 avatar Nov 26 '19 06:11 shahen94