RCTImagePickerManager requires main queue setup warning
See original GitHub issueš Bug Report
On startup, app reports a yellow box warning:
Warning
Module RCTImagePickerManager 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 explocitly opted-out of.
Stack:
logIfNoNativeHook
RCTLog.js:34:8
__callFunction
MessageQueue.js:366:47
<unknown>
MessageQueue.js:106:26
(etc...)
To Reproduce
I think the use of the CameraRoll
library causes the issue. Issue started appearing after an upgrade from React Native 0.57.8 -> 0.58.6.
Expected Behavior
No warning produced.
Code Example
I havenāt been able to reproduce in an expo snack. But in a fresh project, Iāve been able to reproduce it. It requires you to manually link RNCameraRoll to the project in XCode, at which point it will generate a warning, regardless of using the library. Code example (does not produce error in Expo because it isnāt linked): https://snack.expo.io/@scarlac/rctimagepickermanager-error
Screenshot attached.
Environment
ā”ļø react-native info
React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 1.98 GB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.2.0 - ~/.nvm/versions/node/v11.2.0/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v11.2.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 27.0.3, 28.0.2, 28.0.3
System Images: android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom_64
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.6 => 0.58.6
npmGlobalPackages:
react-native-cli: 2.0.1
I looked into the source code and it seems that CameraRoll native modules indeed implement init
but does not specify requiresMainQueueSetup
.
Check out Libraries/CameraRoll/RCTImagePickerManager.m
to see.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:7 (3 by maintainers)
Top GitHub Comments
You can add this code in
RCTImagePickerManager.m
The warning will go away
react native 0.59 still has this warning š