-
Notifications
You must be signed in to change notification settings - Fork 585
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
Android React Native 64bit support #2366
Conversation
Hey - looks like you forgot to add a T:* label - could you please add one? |
Have you tried running it on an actual device?
Then ran it on my OnePlus. It crashes on startup with:
|
@nhachicha @cmelchior We have some ifdefs in https://github.com/realm/realm-js/blob/master/src/android/jsc_override.cpp which can explain the crash. |
Wow! Can't wait for this to be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to go through https://github.com/realm/realm-js/blob/master/src/android/jsc_override.cpp and see if any changes are required.
I'm a bit surprised that a class as magical as https://github.com/realm/realm-js/blob/master/src/android/jsc_override.cpp doesn't have more comments, it is completely opaque what is happening in there 🤔 |
That function patches the beginning of The change needed there is we need an arm64 version of the injected code for the hook. |
@tgoyne Thanks for clarifying. |
Do you know how to fix it in arm64? |
7106ec5
to
0f7c8b0
Compare
Co-Authored-By: Brian Munkholm <bmunkholm@users.noreply.github.com>
@tgoyne @kneth I updated the assembly for AARCH64 & also added some documentation that should help future maintainer https://github.com/realm/realm-js/pull/2366/files#diff-e61c77a661cd0add924e9a8bf52700bdR31 For the future, we should consider migrating into the new bridge (JSI) which allows invoking synchronous calls & also abstract the underlying VM used. FB can switch to V8 or another Javascript engine & we shouldn't rely upon a low-level internal dependency (JavaScriptCore) for our implementation. The assembly was tested on x86, x86_64, arm-v7 & arm-v8 (64bit) |
Switching to JSI is probably going to be the way to go long-term, but as of React Native 0.58 it was going to be all downside: it'd require adding a JSI version of all of the JSC/v8 specific code, it'd add a bit of overhead, and it wouldn't be enough to let us create realm-js as a normal RN module without mucking about with implementation details. If/when that third part changes then the downsides of JSI will be massively outweighed by having something that actually keeps working with new versions of RN. |
Co-Authored-By: Thomas Goyne <tgoyne@gmail.com>
Hi, @nhachicha, I tested on 2.28 it work for simulator and real devices, but when i build on samsung s6, note 8. It's crashed.
|
It looks like the adding Realm to the global context is failing. We currently don't have access to the two specific devices. You mention "tested on [...] real devices" - which ones? |
we tested working on nokia x7, nokia 7 plus, Xiaomi Redmi Note 5A Prime, but it's crash on Samsung s6, samsung note 8 and s8 |
@duynvt-ibl Thanks for the update. Please create a new issue including the stack trace and info on the devices. |
@duynvt-ibl I haven't tested it yet, but when browsing through react-native issues I found this: facebook/react-native#24261. It seems like might be an issue with react-native 0.59.x (just my guess though). |
arm64-v8 dont work, tested on Samsung S7
|
As @kneth mentioned, please open a new issue as discussing on a merged PR is hardly efficient for us to keep track of what's working and what is not. |
@jerson Can you open an issue? |
@nirinchev @kneth @nhachicha Here's the issue: #2391 |
@janczizikow I'm using Kudo's JSC version for fixing the RN issue, but still getting crash, see detail in #2391 |
Tested on x86_64 emulator using
"react": "16.8.3", "react-native": "0.59.8"