Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RNFetchBlob requires main queue setup

Tags:

react-native

When using RNFetchBlob with React Native I get a yellow warning screen that says:

Module RNFetchBlob 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.

I am using react-native 0.56.0 and react-native-fetch-blob: 0.10.8. This worked previously with react-native 0.54.2.

What exactly is this error telling me? What exactly is main queue setup? What should I do to fix this problem? Thanks!

like image 442
kojow7 Avatar asked Jul 15 '18 06:07

kojow7


1 Answers

It turns out that react-native-fetch-blob is no longer supported and I needed to use rn-fetch-blob instead. To fix this I had to do the following:

  1. react-native unlink react-native-fetch-blob
  2. npm uninstall --save react-native-fetch-blob
  3. npm install --save rn-fetch-blob
  4. react-native link

I then had to change all lines that used:

import RNFetchBlob from 'react-native-fetch-blob';

to:

import RNFetchBlob from 'rn-fetch-blob';

Everything is now working the way that it should.

like image 67
kojow7 Avatar answered Oct 26 '22 21:10

kojow7



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!