I implemented a native module on the React Native / Android Project. In the Android native project, I used startActivity function to move to the new activity I created manually. I will share some of the codes.
//MainApplication.java
public class MainApplication extends MultiDexApplication {
...
// Needed for `react-native link`
public List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new AnExampleReactPackage(this)
);
}
...
}
Here, if I use the code new MainReactPackage() then I see the error while running the app on my Android device.
Native module AccessibilityInfoModule tried to override AccessibilityInfoModule for module name AccessibilityInfo. If this was your intention, set canOverrideExistingModule=true
But I'm not sure how I can set the canOverrideExistingModule.
How can I solve this?
Relative Question: React Native: Android activity go back
Check your
MainApplication.java
(under .\android\app\src\main\java\com\projectName) To see if you have the duplicate declarations in method getPackages().
and also check in import.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With