question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

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. screen shot 2019-03-04 at 16 57 36

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:closed
  • Created 5 years ago
  • Reactions:12
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
LuongTruongcommented, Mar 19, 2019

You can add this code in RCTImagePickerManager.m

- (id)init
{
  if (self = [super init]) {
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(cameraChanged:)
                                                 name:@"AVCaptureDeviceDidStartRunningNotification"
                                               object:nil];
  }
  return self;
}

// Please add this one
+ (BOOL)requiresMainQueueSetup
{
  return NO;
}

The warning will go away

1reaction
LuongTruongcommented, Mar 14, 2019

react native 0.59 still has this warning šŸ˜„

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module iCloudStorage requires main queue setup since it ...
When launching my iOS App built with react-native, I get the following warning: Module iCloudStorage requires main queue setup since itĀ ...
Read more >
React Native v0.59.5 Release - GitClear
Pass back correct dimensions for application window in Dimensions (72b4cc by @rdonnelly); Fixed warning: "RCTImagePickerManager requires main queue setup"Ā ...
Read more >
react-native/CHANGELOG.md - UNPKG
42, - Setup a `newArchEnabled` property to Opt-in the New Architecture in the ... 2054, - Fixed warning: "RCTImagePickerManager requires main queue setup"Ā ......
Read more >
react-native-codegen | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
React Native iOs č­¦å‘Šrequires main queue setup warning
2020-03-29 16:22:57.149 [warn][tid:main][RCTModuleData.mm:68] Module RCTGetuiModule requires main queue setup since it overrides `init` butĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found