This blog post is brought to you by the developer of BitBudget. BitBudget is an automated budgeting app for Android and iOS which syncs with your bank account and helps you avoid overspending. If you’d like to quit living paycheck-to-paycheck and get a better handle on your finances, download it today! https://bitbudget.io
Welcome back dear internet friend!
That’s right, while the documentation may “say” that it’s for version 5, as of April 2020 the code samples are all for version 4 and likely will not work if you’ve gone ahead and installed version 5. The fix for this is simple however. Just go ahead and uninstall version 5, and then install version 4 and all shall be well!
$ npm uninstall --save realm
$ npm install --save email@example.com
$ cd ios
$ pod install
$ cd ../
Then try running you’re app again…
$ npx react-native run-android
Furthermore, I think the reason behind this mistake by the Realm team is that they are primarily focused on iOS first, and Android second, and React-Native/NodeJS last! So if you are doing native iOS development you probably should be using version 5 if you’re starting a new project. But if you’re a React-Native or Node developer, you definitely want to be using version 4 until they updated their docs.