joltup/react-native-threads

Error while running react-native-threads

vedant-dobby opened this issue · 2 comments

Hi I'm using React Native: 0.59.10 and Android 9. I have used Jetifier for new packages.
Whenever I'm using react-native run-android, I get the following error.

error: constructor RNThreadPackage in class RNThreadPackage cannot be applied to given types;
            new RNThreadPackage(),
            ^
  required: ReactNativeHost,ReactPackage[]
  found: no arguments
  reason: actual and formal argument lists differ in length
1 error

I'm guessing it has to do with something with the parameters of the constructor and is there a way to fix this temporarily.

I solved this issue by manual linking,

create a file name react-native.config.js and add the following code in this file,

// react-native.config.js
module.exports = {
  dependencies: {
    'react-native-threads': {
      platforms: {android: null},
    },
  },
};

Then follow the doc for manual linking procedure, that's it.