Open neller1 opened 5 years ago
I've done this, but I get a compile error
/TestNative/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:51: 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
FAILURE: Build failed with an exception.
I've definitely added the relevant lines to getPackages
- here's a cut/paste
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new RNThreadPackage(mReactNativeHost));
return packages;
}
Any suggestions?
The same problem. Tried to use tarball version - "react-native-threads": "http://github.com/joltup/react-native-threads/tarball/master"
but it leads to the same error: "error: package com.facebook.react.modules.netinfo does not exist import com.facebook.react.modules.netinfo.NetInfoModule;"
Do we plan to update rnt for 61? Or maybe there are alternatives?
Found how to do the trick.
use https://github.com/jhen0409/react-native-threads/tree/rn61 (or just remove 13 and 49 lines as in the first topic)
yarn add http://github.com/jhen0409/react-native-threads/tarball/rn61
or
npm i http://github.com/jhen0409/react-native-threads/tarball/rn61
manually link the package
react-native link react-native-threads
turn off linking for android (according to https://github.com/joltup/react-native-threads/pull/76 and https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library)
// react-native.config.js
module.exports = {
dependencies: {
'react-native-threads': {
platforms: {
android: null,
},
},
},
};
Dirty hacks but working...
So, now we have 2 issues to get 61:
I was able to fix this by adding this file to the root,
// react-native.config.js
module.exports = {
dependencies: {
'react-native-threads': {
platforms: {
android: null,
},
},
},
};
And then just following the manual linking step. I didn't need to use another repo, this one worked fine with the above
Because netinfo module was deleted in RN 61 we have error: ThreadBaseReactPackage.java:13: error: package com.facebook.react.modules.netinfo does not exist
I commented 13 and 49 strings in ThreadBaseReactPackage.java to temporary start project