Unable to build application
See original GitHub issueI am trying to build my application after adding your threads module when I build I am getting the following error.
:react-native-threads:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE :react-native-threads:compileReleaseJavaWithJavac :react-native-threads:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). /Users/sjain/Documents/Native_App/node_modules/react-native-threads/android/src/main/java/com/reactlibrary/ThreadBaseReactPackage.java:38: error: constructor AndroidInfoModule in class AndroidInfoModule cannot be applied to given types; new AndroidInfoModule(), ^ required: ReactApplicationContext found: no arguments reason: actual and formal argument lists differ in length 1 error :react-native-threads:compileReleaseJavaWithJavac FAILED FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘:react-native-threads:compileReleaseJavaWithJavac’.
I tried to do react-native link but thing is I am also using react-native-navigation
which has bit different implementation of MainApplication.java
file and thus its unable to get the context of ReactApplication.
Below is the implementation of my MainApplication.java file ` public class MainApplication extends NavigationApplication {
@Override
public boolean isDebug() {
// Make sure you are using BuildConfig from your own application
return BuildConfig.DEBUG;
}
protected List<ReactPackage> getPackages() {
// Add additional packages you require here
// No need to add RnnPackage and MainReactPackage
return Arrays.<ReactPackage>asList(
new RNThreadPackage()
);
}
@Override
public List<ReactPackage> createAdditionalReactPackages() {
return getPackages();
}
@Override
public String getJSMainModuleName() {
return "index";
}
} `
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (3 by maintainers)
Top GitHub Comments
I’m using react-native
0.52
and the constructor ofAndroidInfoModule
not acceptscatalystApplicationContext
as parameter. So the PR #23 breaks the compatibility with react-native 0.52.After debugging a bit looks like some import issue, package works fine. @sja1n have u tried calling apis from this package? I am looking to build a notification feature which calls my api every few seconds to update the count and data.