Realm-js: Native module RealmReactModule tried to override RealmReactModule for module name Realm

Created on 3 Jun 2016  Â·  5Comments  Â·  Source: realm/realm-js

I use react-native 0.26.3 and realm 0.13.2, but when I finish linking my project and run, I got this problem blow....why???

java.lang.IllegalStateException: Native module RealmReactModule tried to override RealmReactModule for module name Realm. If this was your intention, return true from RealmReactModule#canOverrideExistingModule()
at com.facebook.react.bridge.NativeModuleRegistry$Builder.add(NativeModuleRegistry.java:213)
at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:898)
at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:825)
at com.facebook.react.ReactInstanceManagerImpl.access$700(ReactInstanceManagerImpl.java:102)
at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:198)
at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:181)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

T-Bug

Most helpful comment

It looks like the RealmReactPackage was somehow included twice. Can you check that it only appears once in the getPackages() method inside MainActivity.java?

All 5 comments

It looks like the RealmReactPackage was somehow included twice. Can you check that it only appears once in the getPackages() method inside MainActivity.java?

Oh...yes, you are right. RealmReactPackage was included twice, It's my
fault. Thank you very much.

2016-06-06 17:15 GMT+08:00 Scott Kyle [email protected]:

It looks like the RealmReactPackage was somehow included twice. Can you
check that it only appears once in the getPackages() method inside
MainActivity.java?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/realm/realm-js/issues/471#issuecomment-223907337, or mute
the thread
https://github.com/notifications/unsubscribe/AFZF89_G8ykvb_hSoWbmS6TKS5MoQn9Rks5qI-U-gaJpZM4ItYAn
.

I'm getting this upgrading my project to RN 0.39 (npm install [email protected] --save && react-native upgrade) and not doing any other changes.

It had added duplicates of my packages in MainApplication.java.

Thank you @appden and the reason for the duplication was because I executed react-native link in the process of adding a new font..I deleted the duplicated lines and it works fine..thanks

I ran into a similar problem and ran react-native unlink [module-name] which fixed my issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fever324 picture fever324  Â·  4Comments

texas697 picture texas697  Â·  3Comments

timanglade picture timanglade  Â·  3Comments

CrystalRanita picture CrystalRanita  Â·  3Comments

MihaelIsaev picture MihaelIsaev  Â·  3Comments