Ui: Native module RNSShareModule tried to overide RNShareModule for module name RNShare.

Created on 4 Jan 2017  路  15Comments  路  Source: shoutem/ui

react-native

bug

Most helpful comment

I ran into the same error but I found a solve inspired by this post
https://github.com/GeekyAnts/NativeBase-KitchenSink/issues/19
The problem is 'react-native link' executed twice by mistake.
I solved it by

  1. removing the duplicate entries in android/settings.gradle and duplicate declarations in method getPackages() of android/app/src/main/java/com/~~~/MainApplication.java
  2. delete all files in android/app/build
  3. try again react-native run-android

Hope it works for you

All 15 comments

running RestaurantApp error

Hey @mihretSh, thank you for submitting this issue, could you give us more details on how to reproduce it?

Thank you for your quick response , I was trying to run Restaurants app and follow the steps as mentioned in the description :

  1. I clone the project from https://github.com/shoutem/ui.git
  2. Locate to RestaurantsApp folder
  3. Install and link dependencies:
    npm install
    react-native link
    4 . when I run using react-native run-android it creates the above error

Hey @mihretSh, I also faced with this problem... actually, a don't know why, but after following all steps from the readMe I saw that some files were changed. And this was the reason. So just use git to revert changes and this issue should be fixed.

However, then I faced with the other problem... http://prntscr.com/driv9d....
will be grateful for the help.

Hey @RomanPerin, thank you for suggesting a solution. Error you have attached is known issue in RN0.39.0, but is fixed with 0.39.2, so please check what version is installed after you have reverted some of our changes. Also, I believe that unlinking react-native-share or manually removing all references from project and then just do react-native link, should fix original issue. If it does, could I ask you to submit the PR with fix?

I have tried to push my changes but I'm getting 403 error...
So, let me describe:

  1. Let's upgrade package.json with new version of react-native ("react-native": "0.39.2").

The main issue was caused by the 'react-native link' command, as it adds already existed lines of code.
http://prntscr.com/drkhku
http://prntscr.com/drkhzm
http://prntscr.com/drkia5
http://prntscr.com/drkion

  1. So, if to remove this lines of code, then 'react-native link' will add the same lines of code but they won't be duplicated. And everything will be all right.
    However, it seems strange to me that this command updates files... so it is natural that in this case I want to add these line of code again to the project -> next call of 'react-native link' will cause the same issue again.
    So, maybe there is another way how to fix it?
    I'm learning react\react-native only for few days,... this world is new for me, so @SoHotSoup, what do you think?

RN 0.40 facing the same error on Windows 10 as OP

This should be fixed with the latest release. Could you guys @mihretSh @AldrichMascarenhas @RomanPerin test it now and close the issue?

RN 0.42.2 windows 10 still got the error @SoHotSoup

tried with RN 0.42.2 windows 7. Even getting same error

tried today as of April 25th : still the same issue.
Got latest repo this morning on a fresh install.

Hey @Benouzef you get this error also on RestaurantsApp example?

Yup, same thing: I wanted to run the sample app. It crashed with this error.

Quick update : message is the same however stack trace shows

  • addNativeModule (NativeModuleRegistryBuilder.java: 101)
  • processPackage (NativeModuleRegistryBuilder.java: 89)
  • processPackage (ReactInstanceManager.java : 950)

I ran into the same error but I found a solve inspired by this post
https://github.com/GeekyAnts/NativeBase-KitchenSink/issues/19
The problem is 'react-native link' executed twice by mistake.
I solved it by

  1. removing the duplicate entries in android/settings.gradle and duplicate declarations in method getPackages() of android/app/src/main/java/com/~~~/MainApplication.java
  2. delete all files in android/app/build
  3. try again react-native run-android

Hope it works for you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

awnali picture awnali  路  4Comments

mypark picture mypark  路  6Comments

tdurand picture tdurand  路  8Comments

alejandronanez picture alejandronanez  路  9Comments

Kodax9 picture Kodax9  路  3Comments