-
Notifications
You must be signed in to change notification settings - Fork 594
Missing Realm constructor or duplicated symbols #2634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Confirm that only iOS platform experience this bug, Android still work properly. |
I haven't been able to reproduce it. I am using Realm JS v3.5.0 and React Native v0.61.2 but on macOS v10.14.6 and Xcode 11.0 (build version 11A420a). |
Running into this same issue on a pre-existing project that was previously using Realm JS v2.29.2. On macOS v10.4.6, RN v.0.61.2 and Xcode 11.2.1. |
@kneth I created a new project and also added |
@gangwarily After I added all the packages from pre-existing project to the new one, my new project ran into the same issue as the existed project. Let's compare to see which packages we have the same
|
@hauhuynh1208 You can send it to |
@kneth I think I found the way how you can reproduce the bug. First of all, init the fresh project. Then install realm, make sure app is running properly. Then you install any packages (such as redux, react-native-maps ...). Then bug occurs
I sure you will encounter this bug :) |
@hauhuynh1208 I do encounter the bug. We believe it is a Currently, two workarounds are possible: use |
@kneth, I'm using npm and running into the same issue. Not sure if there are multiple causes for this :/ |
@kneth I have tried postinstall solution before, and it still fail. And I just tried npm, but still no luck. Did you do these solutions successfully? |
What happens if you run |
@hauhuynh1208 Search your ios/YourProject.xcodeproj for "realm". Mine had dozens of realm entries. I think this may be a problem when upgrading existing projects. Not sure how best to solve. Option A
Option B
I ended up rolling back to "realm": "^3.2.0" and manually adding and linking the realm project in xcode. I spent so much time on this trying so many things. I and not sure what finally sorted things out. File: react-native.config.js
I am sticking with realm 3.2.0 for now:
|
@esutton while I applaud your eager to find alternative solutions and I am happy you personally got your stuff working, it really doesn't need to be that difficult.. I believe the minority of Realm JS issues we're seeing on iOS stem from old files in If you create your own issue (with a link to your project on GitHub or a request for an email address to which you can send it privately), I'll be happy to take a look at what's wrong and help resolve any Realm related issues. |
@kraenhansen In tried rm -rf ios/build multiple times without success. Adding postinstall work-around did not help. I did not forget pod install Yes, something appeared to mess up Xcode project. This occurred * before * I manually edited the xcode project. I am also using redux. |
@kraenhansen In my existed project, I always remember to |
@gangwarily Did you remove the contents of |
@hauhuynh1208 @esutton You use try to use |
@kneth I tried |
@hauhuynh1208 Can you create a small project which can reproduce the issue and share it with us? |
I did yeah. Pretty much tried all the things @hauhuynh1208 tried out. :/ |
@kneth here is my small git: I did the following steps:
|
@hauhuynh1208 As outlined earlier, the command |
@kneth I followed your instruction, the example project is working normally. But I applied the same to my existed project, and the project still fail to build. How can I send you this existed project privately so that you can help me take a look? |
I got the same issues |
"react-native": "0.61.2", If run If run project in xCode to simmulator - Error: Missing Realm constructor. Did you run "pod install"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting If remove folder UPD: Go to xCode menu |
@ruslanaplid I even though cannot run project by |
@hauhuynh1208 we just released a version of Realm JS with a fix that could very well solve your issue too. I just ran the following without errors:
Can you confirm that the latest version of Realm JS (v2.6.0) solves your issue? |
@kraenhansen I confirm that my example project now work perfectly. But my existed project still fail. Btw, thank you very much for your help :D |
@hauhuynh1208 my best suggestion is to initialize a new React Native project, copy over the dependencies from the I'm closing this issue for now, please open a new with a link for a GitHub repository with a minimal reproduction if you find a similar issue (or can distill your existing project somehow). |
I found the solution:
Hope my workaround could help who are got stuck on running existed project with realm :) |
I spent 2 hours on this, and this fixed my problem. Be sure to tap options to make Clean -> Clean Build Folder |
i spend 2 hours too, and then I found your answer ... |
One thing that wasn't obvious to me was to hold the option key while selecting the product menu to get the Cleaning the build folder fixed it for me |
I'm facing the exact same cleaning build folder didn't work. any help? RN: 0.61.5, Realm: 3.2.0 |
Same problem :( Tried everything from cleaning build folder, to deintegrate pods, restarted everything. |
I have this problem too, I upgrade Realm 3.2.0 to Realm 10.2.0 due to iOS 14.5 beta crash, but always encounter this missing Realm constructor issue, this really drive me to crazy, I have tried all the ways I could think of and read all the solutions above, still cannot resolve this. I'm really upset about this, this issue keeps showing up to developers but still cannot be resolved totally, I decide to remove this entirely from my project and never use it again! |
I have the same issue like @mrarronz -> upgrading from Realm 3.2.0 to the newest 10.2.0. |
@kneth I upgrade React Native to 0.63 and Realm to v10.2.0, always encounter this issue. After struggling for two days, I finally resolve this issue. It takes a big effort to replace this library in my project so I have to keep it at this moment. Since the iOS 14.5 beta crash seems already be resolved in v6(#3557), so I just upgrade Realm to v6.1.6 instead of v10.2.0. Here are my steps to fix this, hope it would be helpful to anyone who are facing this problem.
What a painful process! I finally resolve this after trying a lot, but I have no confidence that it would always run successfully on somewhere else. |
@mrarronz Thank you for providing a detailed guide on how to upgrade. |
Uh oh!
There was an error while loading. Please reload this page.
Goals
Using Realm normally
Expected Results
Actual Results
after install Realm and
pod install
, app will launch with errorMissing Realm constructor
. After research through github, I found that we should linklibRealmReact.a
toLink binary with libraries
. But after linked, app throw error that155 duplicate symbols for architecture x86_64
.Steps to Reproduce
react-native init exampleProject
yarn add realm
cd ios && pod install
Code Sample
import Realm from 'realm
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: