I am using an old version of react-native-webview for iOS and the latest version for Android in a react-native app. App runs in iOS successfully, however Android gives an error that says "Native module RNCWebView tried to override RNCWebViewModule..." I checked getPackages() in MainApplication.java but there is no duplicate creation or multiple imports for react-native-webview or react-native-webview-latest.
Also, I added
@Override
public boolean canOverrideExistingModule() {
return true;
}
to RNCWebViewModule.java file under node_modules/react-native-webview-latest/... but it does not work.
Relevant lines from package.json file:
"react-native-webview": "6.11.1",
"react-native-webview-latest": "npm:react-native-webview@11.6.2",
How can eliminate this error and get a successful Android run?