Closed ajithamp closed 7 years ago
Same here on IOS. I linked the library by running "react-native link realm" and also checked if it is included in "Build Phases -> Link Binary With Libraries" in Xcode. But I still get the same error.
hi, if u r using Android
add following in MainApplication.java
import io.realm.react.RealmReactPackage;
protected List
add following two lines in settings.gradle include ':realm' project(':realm').projectDir = new File(settingsDir, '../node_modules/realm/android')
same error. using version
"react": "15.3.2",
"react-native": "0.35.0",
"realm": "^0.14.3"
found what's wrong here.
Need to at least invoke any method for ReactRealm class to be loaded, so it can go through the module registration process.
add
#import <RealmReact/RealmReact.h>
and then in anywhere of your application. it doesn't need to be executed, just need to be there.
NSLog(@"%@", [RealmReact class]);
@caoer very interesting! Sounds like symbols might be getting stripped. Will see if we can reproduce this by fiddling with the build settings.
@caoer could you explain again your solution with an example code? I did not quite understand. Thank you
@brunobraga95 just include RealmReact anywhere in the application; I guess there might be something related to lib load process. If you don't include <RealmReact/RealmReact.h> related lib won't get loaded.
Sorry to ask, I am new with native, but when you say to just include RealmReact, should I just
import Realm from 'realm'
Or there is another way to manually do it?
Hey all, We're getting this as a root cause for crashes reported by several users in our Production env. Mainly after CodePush downloads a new update for the app, and is about to restart the app.
Would really appreciate it if someone can shed some light on how can it happen in Production... :/
Thanks! Guy
@geldarhb Hey, have you found out what the problem is?
@stefanwuest are you still getting this? Which version of Realm are you using?
I have crash reports on my production app. Can't reproduce it though.
Using "realm": "^0.14.3"
okay. Perhaps try upgrading. Or let me know if you get more information.
@geldarhb @stefanwuest Any luck finding a solution for this? I'm seeing this too only in release and test flight builds.
I'm experiencing this too, was fine on RN 38 but since upgrading to 47 and now 48 we've been trying to trace this issue (iOS only). About to part ways with Realm. What's strange is, when the app appears to exit, if you double click home you'll see it sitting in the background.
@Kdoherty11 @jbcullis We would love to help fix this, but we are unable to reproduce this ourselves, so anything that can help with that would be appreciated.
@Kdoherty11 Issue appeared after upgrading from RN 38.0 and Realm 1.2.0
Currently have tested on: RN 47.2 and 48.2 with realm 1.11.1, all dependencies have been upgraded to latest.
You can open the app a few times and it's fine and then randomly it will fail to load but this is only presenting itself in release on device. As someone mentioned in this thread or another it seems to get worse after a code-push.
My only dependencies are realm, codepush and now bugsnag. I can confirm it was broken before we added bugsnag and that's how we finally saw the error being thrown.
Could you possibly provide us a sample app (in private) that shows this behavior?
@bmunkholm - I'm just testing a theory and then I'll put together a sample.
@bmunkholm - I can confirm that realm is the issue, libraries still in place but commented out the import and usage on launch page and no crashes.
@jbcullis Great - it would be awesome with a repro sample!
@bmunkholm - Further information. There appeared to be two things going wrong, first was 'missing realm constructor' however it seems we've fixed that by moving first usage to login rather than at launch. Unfortunately, we still had that weird behavior where the app hangs just after the launch screen however it doesn't exit, it disappears but if you double click the home button the app is available in the background. We decided to try and lazy load the library at login, just before first usage which seems to have solved the issue.
In summary, I'm sure it's a timing issue so I'm going to try the solution outlined by @caoer to see if that yields the same result as lazy loading.
@jbcullis Did the outlines solution help you?
@kneth - No, the only way I was able to eliminate the problem was to load the library after the app had completed loading. So I left the const as null until the user logged in and then set the value at that point. For us, it feels hacky but there is no ramification since we don't set any offline data until the user logs in.
@bmunkholm - I haven't had a chance to get a sample together yet. Now that we have our production app bug free I hope to take a look at this later in the week.
@jbcullis We will look forward to a little sample project.
I am closing the issue. If you have a sample project, don't hesitate to reopen the issue.
i got above error