Native module IntercomWrapper tried to override IntercomModule.
See original GitHub issueI followed all the instructions described in the installation guide: https://github.com/tinycreative/react-native-intercom/blob/master/README.md
Then I tried to run the app on my Android device and I’m having the following error: Native module IntercomWrapper tried to override IntercomModule. Check the getPackages() method in MainApplication.java, it might be that module is created twice. If this was your intention, set canOverrideExistingModule=true
I double checked and I haven’t imported twice the same package.
Here’s the content of my getPackages() method:
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new RNFirebaseMessagingPackage());
packages.add(new RNFirebaseAnalyticsPackage());
packages.add(new RNFirebaseNotificationsPackage());
packages.add(new ReactVideoPackage());
packages.add(new IntercomPackage());
return packages;
}
When removing the import of IntercomPackage
from the getPackages() method, it does launch my app without issues, so it is related to this import but I’m not sure what’s going on here.
Any help would be appreciated, thanks !
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
@anthonycaron @StijnCoolen what is a version of react-native do you use? If it a react-native version 0.60+ with auto-linking then it is really twice. The first one auto-linking does and the second you do with
packages.add(new IntercomPackage());
.I’ve managed to run this package on
RN 0.61.5
only after excluding it from auto-linking (android) via react-native.config.jsAnd then link the package manually as we did before RN 0.60, otherwise it just not working. On iOS it works as expected.
Manually linking on android (old way)
Hi Guys. I was having the same issue as the original poster. I followed the unlinking instructions and it now “works”, however as soon as I call
Intercom.registerIdentifiedUser({ userId: 'bob' });
(for example), it creates/updates the user, but then it crashes. Constantly. The only way to get it open again is to delete and re-run.Unfortunately the crash disappears as soon as I try to get more details, so not able to say exactly what the error is (and nothing is logged to the console or terminal). The error does make reference to an invalid color in io.intercom… but that’s all I really see in the split second it stays open.
Do you have any suggestions?
Many thanks in advance!