Closed zdzichukowalski closed 6 years ago
I had the same problem today. I managed to get it working by:
react-native eject
react-native link
Well, it didn't help in my case, everything stays the same.
Is there any explanation behind your solution, or was it random idea that did work? I'm fairly new to RN, and would like to know if deleting native folders is common solution to unexpected situations.
I suspected that the problem could be in .xcodeproj file. One of the biggest pains for me using RN is solving merge conflicts in .xcodeproj file, and we get quite a few of those on new projects.
Had the same today on RN 0.47 & iOS 10.3 iPhone 6 for a few times before restarting app/server/build
Since we release 2.0 last week, I would like to hear if you see the error with that version?
Yes the error still persists with 2.0. It worked for a while and now the error reappears :(
Edit: Only happens when remote js debugging is turned on!
Created #1436 which fixes the issue for me! @kneth please have a look :)
I'm still meet this issue. How to fix it :(
We plan to do a release early next week where the fix (#1436) is included.
+1 Can run on ios but not android
@sabbyt54 Which version of Realm JS are you using?
Are you using wix/react-native-navigation
? If you are there will be 2 getPackages()
methods in your MainApplication.java
, do make sure both methods are returning new RealmReactPackage()
.
@kneth "realm": "^2.2.10" "react": "16.2.0", "react-native": "0.52.2",
In case it helps anyone, I had this issue as well when running an Expokit project, until I disabled Live Reload.
@jarodhanko Expo does not yet support Realm.
@kneth I ejected from Expo to use ExpoKit which allows the use of react-native link, which worked for my use-case (react native queue).
@jarodhanko Thanks for the update. It might be useful to others so maybe you can write a small post about it? For example at medium.com?
Is there any plan to support Expo?
1) try to delete the application from the device 2) run react-native run-android again you will be ok
reinstalling the app worked for me. This should be explicitly mentioned in the documentation. Any concerned person, please have a look or redirect me to the steps to fix it.
I am facing the exact same issue. I am using ExpoKit 27.0.1, Realm 2.14.2, Redux and Redux-Thunk. I am running Realm operations from inside a Redux Action. I have tried everything described in the documentation and also what other users shared. Nothing really works for me. I am almost abandoning Realm because of this. Not sure if I should try to downgrade libraries versions....
@pedrosimao As mentioned in our documentation, Expo doesn't support Realm.
@kneth got it!
it worked for me when I added the following line to MainApplication.java protected List getPackages() { return Arrays.asList( new MainReactPackage(), new RealmReactPackage() // add this line ); }
Note: don't forget to import io.realm.react.RealmReactPackage;
I ejected CRNA and the error disappeared.
As for me, Realm was working fine in Android but was throwing the above-mentioned error in iOS. Simple fix that I did was opened my project in xcode, AppDelegate.m file had error message poping up in the following line of code,
#import <React/RCTBundleURLProvider.h>
to fix it I went to Product > Schema > Manage Schema and then added React to the list.
in my case I was not doing a "react-native run-android" after including realm code
In my case, It happened on IOS because I deleted libRealmreact.a file away from Link Binary with libraries. Make sure you have linReaclReact.a in Xcode => build phases => link binary with libraries
from above 0.60 react native projects, auto link is not working either maintainers of the package has to code for auto linking project while doing npm install
starting from 0.61 react native ios project, realm cannot support anymore, as react native had remove its react project from ios library.
starting from 0.61 react native ios project, realm cannot support anymore, as react native had remove its react project from ios library.
You mean that "We cannot use Realm for React Native version 0.61? Accoring to the lastest installation guide, we still can install with React Native >0.60 https://realm.io/docs/javascript/latest/
Mine, "react": "16.9.0", "react-native": "0.61.5", "realm": "^4.0.0-beta.0"
And still have an issue Unable to open a realm at path: Unsupported Realm file format
Any suggestion please help. Thanks
@softmastx Your error message ( Unable to open a realm at path: Unsupported Realm file format
) indicates the Realm JS is loaded in your app. But it seems what you believe is a Realm file, isn't a Realm file.
Since you are using v4.0.0-beta.0, I would like to learn more. v4.0.0 will bring us a new file format, and old files will be automatically upgraded. If you are still observing the error, please create a new issue for it as it could indicate the file format upgrade has a bug.
Use this
npm install realm@hermes
Work's for me.
Goals
Build under Ubuntu, on Android emulator, simple react-native project, which imports realm
Expected Results
Application runs without problems
Actual Results
Emulator(red screen of death): Missing Realm constructor. Did you run "react-native link realm"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting
Console: Missing Realm constructor. Did you run "react-native link realm"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting Module AppRegistry is not a registered callable module (calling runApplication)
Steps to Reproduce
Install Ubuntu 17.04/ get RN up and running/ using Webstorm create new RN project/ add
import realm from 'realm'
line to your code/ runreact-native link realm
and check that everything is linked properly/try buildingCode Sample
MainApplication.java
settings.gradle
Version of Realm and Tooling
Remarks
Other module, specifically SplashScreenReactPackage which also needs adding package to
getPackages()
in MainApplication.java works correctly.