React Native: Android Base Module

I implemented my own module for the React Native / Android Project. In an android based project, I used the startActivity function to go to the new action that I created manually. I will share some 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() , I see an error when starting the application on my Android device.

The native AccessibilityInfoModule module tried to override the AccessibilityInfoModule for the AccessibilityInfo module name. If that was your intention, set canOverrideExistingModule = true

But I'm not sure how to install canOverrideExistingModule . How can i solve this?

Relative question: React Native: Android activity will return

+5
source share
1 answer

Are you sure you want to override AccessibilityInfoModule? If so, just add this to your NativeModule class

 @Override public boolean canOverrideExistingModule() { return true; } 
0
source

Source: https://habr.com/ru/post/1270139/


All Articles