realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

React native can't get Realm Module on the android when activate new architecture

Open lucaszk12 opened this issue 2 years ago • 8 comments

Description

I enable new architecture on the android and ios with react native 0.69.1. On ios, It's working. But on android, It's can't connect with realm native module.

Stacktrace & log output

Missing Realm constructor. Did you run "pod install".

Can you reproduce a bug?

Yes, always

Reproduction Steps

  1. in file android/gradle.properties set newArchEnabled=true
  2. in file android/app/build.gradle set enableHermes: true
  3. After that, I new Realm connection const realm = await Realm.open({ path: "testdatabase", schema: [UserSchema], schemaVersion: 1 })
  4. yarn android I receive the error below. Screen Shot 2022-07-20 at 19 24 20

Version

^11.0.0-rc.1

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Android Simulator '10.1_WXGA_Tablet_API_31(AVD) - 12'

lucaszk12 avatar Jul 20 '22 12:07 lucaszk12

If i set newArchEnabled=false in file android/gradle.properties. it's working on android.

lucaszk12 avatar Jul 20 '22 12:07 lucaszk12

@phanmduong thanks for reporting this. The new architecture is quite experimental, so at the moment we cannot guarantee everything will work when it is activated. We will, however, be working to ensure we are fully compatible with it before it is activated by default.

In any case, we will be investigating this issue.

takameyer avatar Jul 22 '22 09:07 takameyer

@takameyer thanks guy, I will wait for you to fix this problem

lucaszk12 avatar Jul 25 '22 10:07 lucaszk12

Same problem here in RN 0.69.4

RalissonMattias avatar Aug 10 '22 17:08 RalissonMattias

@phanmduong thanks for reporting this. The new architecture is quite experimental, so at the moment we cannot guarantee everything will work when it is activated. We will, however, be working to ensure we are fully compatible with it before it is activated by default.

In any case, we will be investigating this issue.

@takameyer

The point is that the Realm 11.0.0-rc.1 doesn't work at all with the new version of the react native (react native 0.69 or 0.70rc) when hermes is enable. Not to mention here the new architecture that become a legend.

Try to create a new RN project from the scratch (react native 0.69 or 0.70rc) and then install realm 11.0.0-rc.1. It doesn't work in any circumstances.

I believe that should be a priority for the Realm team, otherwise developers and companies who adopted React Native as solution will not be able to use Realm in their projects anymore. Depending on the project the migration from Realm to Watermelon is a hard task. But I think we're running out of options here.

brunoducattii avatar Sep 05 '22 13:09 brunoducattii

@joaotmachado Please create a new issue with details on what is not working and how you configured your project. This is definitely a priority for us.

takameyer avatar Sep 05 '22 13:09 takameyer

@joaotmachado Please create a new issue with details on what is not working and how you configured your project. This is definitely a priority for us.

here it goes @takameyer thank you in advance: https://github.com/realm/realm-js/issues/4866

brunoducattii avatar Sep 05 '22 13:09 brunoducattii

@takameyer i updated the issue https://github.com/realm/realm-js/issues/4866 because React Native 0.70 is officially released and as expected Realm doesn`t work at all with 11.0.0-rc.1.

brunoducattii avatar Sep 05 '22 18:09 brunoducattii

@joaotmachado Please try to upgrade to RJS v10.2.0.

kneth avatar Nov 21 '22 19:11 kneth

This should be fixed for the latest Realm at v11 and react-native at v70

takameyer avatar Jan 03 '23 11:01 takameyer