shahen94 / react-native-video-processing

Native Video editing/trimming/compressing :movie_camera: library for React-Native
https://shahen94.github.io/react-native-video-processing/
MIT License
1.25k stars 325 forks source link

RNVideoTrimmer, RNTrimmerViewManager requires main queue setup #183

Open osdiab opened 6 years ago

osdiab commented 6 years ago

Current Behavior

Yellow warnings when running the app, saying:

Module RNTrimmerViewManager requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
console.warn @ YellowBox.js:67
logToConsole @ RCTLog.js:47
logIfNoNativeHook @ RCTLog.js:30
__callFunction @ MessageQueue.js:344
(anonymous) @ MessageQueue.js:107
__guard @ MessageQueue.js:291
callFunctionReturnFlushedQueue @ MessageQueue.js:106
t @ RNDebuggerWorker.js:1
YellowBox.js:67 Module RNVideoTrimmer requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
console.warn @ YellowBox.js:67
logToConsole @ RCTLog.js:47
logIfNoNativeHook @ RCTLog.js:30
__callFunction @ MessageQueue.js:344
(anonymous) @ MessageQueue.js:107
__guard @ MessageQueue.js:291
callFunctionReturnFlushedQueue @ MessageQueue.js:106
t @ RNDebuggerWorker.js:1

YellowBox.js:67 Module RNVideoTrimmer requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
console.warn @ YellowBox.js:67
logToConsole @ RCTLog.js:47
logIfNoNativeHook @ RCTLog.js:30
__callFunction @ MessageQueue.js:344
(anonymous) @ MessageQueue.js:107
__guard @ MessageQueue.js:291
callFunctionReturnFlushedQueue @ MessageQueue.js:106
t @ RNDebuggerWorker.js:1

Expected Behavior

No such warnings

Your Environment

Shows up on iOS (haven't checked android), package.json relevant dependency versions:

{
  "dependencies": {
    "react": "16.4.1",
    "react-native": "^0.56.0",
    "react-native-video-processing": "shahen94/react-native-video-processing"
  },
  "devDependencies": {
    "babel-preset-react-native": "^5.0.2"
  }
}

Node 9.3.0 react-native-video-processing version in yarn.lock: e7262a3fec73e26b3a77aac83eae278a130a0773, yarn list shows that it's @1.7.1

recepkocur commented 6 years ago

I've just fixed this.

1) RNVideoTrimmer.swift

@objc(RNVideoTrimmer)
class RNVideoTrimmer: NSObject {
   ...
+   @objc class func requiresMainQueueSetup() -> Bool {
+      return true
+   }
}

2) RNTrimmerViewManager.swift

@objc(RNTrimmerViewManager)
class RNTrimmerViewManager: RCTViewManager {
    ....
+    override class func requiresMainQueueSetup() -> Bool {
+      return true
+    }
}

3) Clean and Run

Hope this helps :)