Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNSound requires main queue setup since it overrides #308

Open
gastonmorixe opened this issue Nov 11, 2017 · 4 comments
Open

RNSound requires main queue setup since it overrides #308

gastonmorixe opened this issue Nov 11, 2017 · 4 comments

Comments

@gastonmorixe
Copy link

Module RNSound requires main queue setup since it overrides `constantsToExport` 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.

@sagivo
Copy link

sagivo commented Dec 1, 2017

and to add another warning:

RCTLog.js:48 Module RNInCallManager 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.

@ZackTRobertson
Copy link

I'll also add this as I'm seeing the same errors.

Module RCTImageLoader 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.
logToConsole @ RCTLog.js:48
logIfNoNativeHook @ RCTLog.js:31
__callFunction @ MessageQueue.js:353
(anonymous) @ MessageQueue.js:118
__guardSafe @ MessageQueue.js:316
callFunctionReturnFlushedQueue @ MessageQueue.js:117
(anonymous) @ debuggerWorker.js:72

Then, if I try to load an audio file...

{code: "ENSOSSTATUSERRORDOMAIN2003334207", message: "The operation couldn’t be completed. (OSStatus error 2003334207.)", nativeStackIOS: Array(19), domain: "NSOSStatusErrorDomain", userInfo: {…}} code : "ENSOSSTATUSERRORDOMAIN2003334207" domain : "NSOSStatusErrorDomain" message : "The operation couldn’t be completed. (OSStatus error 2003334207.)" nativeStackIOS : Array(19) 0 : "0 AudioTest 0x000000010f45f886 RCTJSErrorFromCodeMessageAndNSError + 134" 1 : "1 AudioTest 0x000000010f45f7b3 RCTJSErrorFromNSError + 275" 2 : "2 AudioTest 0x000000010f608cf4 -[RNSound prepare:withKey:withOptions:withCallback:] + 1588" 3 : "3 CoreFoundation 0x0000000111c2b36c __invoking___ + 140" 4 : "4 CoreFoundation 0x0000000111c2b240 -[NSInvocation invoke] + 320" 5 : "5 CoreFoundation 0x0000000111c43c26 -[NSInvocation invokeWithTarget:] + 54" 6 : "6 AudioTest 0x000000010f3f594c -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2796" 7 : "7 AudioTest 0x000000010f4a52e2 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 786" 8 : "8 AudioTest 0x000000010f4a4e0f _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 127" 9 : "9 AudioTest 0x000000010f4a4d89 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 25" 10 : "10 libdispatch.dylib 0x0000000116762177 _dispatch_call_block_and_release + 12" 11 : "11 libdispatch.dylib 0x00000001167631ba _dispatch_client_callout + 8" 12 : "12 libdispatch.dylib 0x000000011676ad3d _dispatch_queue_serial_drain + 654" 13 : "13 libdispatch.dylib 0x000000011676b5a0 _dispatch_queue_invoke + 329" 14 : "14 libdispatch.dylib 0x0000000116767c97 _dispatch_queue_override_invoke + 477" 15 : "15 libdispatch.dylib 0x000000011676d980 _dispatch_root_queue_drain + 568" 16 : "16 libdispatch.dylib 0x000000011676d6ea _dispatch_worker_thread3 + 119" 17 : "17 libsystem_pthread.dylib 0x0000000116c225a2 _pthread_wqthread + 1299" 18 : "18 libsystem_pthread.dylib 0x0000000116c2207d start_wqthread + 13" length : 19 __proto__ : Array(0) concat : ƒ concat() constructor : ƒ Array() copyWithin : ƒ copyWithin() entries : ƒ entries() every : ƒ every() fill : ƒ fill() filter : ƒ filter() find : ƒ find() findIndex : ƒ findIndex() forEach : ƒ forEach() includes : ƒ includes() indexOf : ƒ indexOf() join : ƒ join() keys : ƒ keys() lastIndexOf : ƒ lastIndexOf() length : 0 map : ƒ map() pop : ƒ pop() push : ƒ push() reduce : ƒ reduce() reduceRight : ƒ reduceRight() reverse : ƒ reverse() shift : ƒ shift() slice : ƒ slice() some : ƒ some() sort : ƒ sort() splice : ƒ splice() toLocaleString : ƒ toLocaleString() toString : ƒ toString() unshift : ƒ unshift() Symbol(Symbol.iterator) : ƒ values() Symbol(Symbol.unscopables) : {copyWithin: true, entries: true, fill: true, find: true, findIndex: true, …} __proto__ : Object userInfo : {} __proto__ : Object

Hopefully I'm just invoking this library the wrong way, but the code I use for android with the same library works fine.

@ZackTRobertson
Copy link

I've looked into this issue and here is my thinking as of now:

  1. The requiresMainQueueSetup is not raised when using React Native 0.51 and react-native-sound 0.10.5 (yarn install) on the ios simulator. I have not tested on an actual device. Some errors people are seeing could be due to react native 0.52 issues or could be with using npm install/save. If others are experiencing problems then try this configuration.
    Furthermore, I see the requiresMainQueueSetup warning on the RTCImageLoader when using RN 0.52, and this issue has been raised by others as well (17504). Given all the other dependency issues 0.52 has raised I'm sticking with 0.51 on both android and ios.

  2. As per the second error I posted it luckily had to do with my invoking of the library so the error was completely on my side. I've since tested and can confirm basic functionality.

@alfonsodev
Copy link

On react-native 0.60.4
I'm getting yellow boxes with

2019-08-31 12:19:24.805 [warn][tid:com.facebook.react.JavaScript][RCTModuleData.mm:310] Required dispatch_sync to load constants for RNSound. This may lead to deadlocks

I think this is related with requiresMainQueueSetup but I'm not fully understanding it,
I've seen requiresMainQueueSetup returns YES and has been like that for a while.
51864a8

Could someone explain why this warning shows up ? should we ignore it and add it to the docs ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants