realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.62k stars 558 forks source link

The "bundle install & & RCT_NEW_ARCH_ENABLED=1 bundle exec pod install" command results in the error "Could not find the Realm binary." #6640

Open wisdomstar94 opened 2 weeks ago

wisdomstar94 commented 2 weeks ago

How frequently does the bug occur?

Always

Description

Enabling the new architecture of "react native" will result in an error, and if not enabled, no error will occur.

Stacktrace & log output

(NOBRIDGE) ERROR  Error: Could not find the Realm binary. Please consult our troubleshooting guide: https://www.mongodb.com/docs/realm-sdks/js/latest/#md:troubleshooting-missing-binary 
    at TestScreen (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:143169:41)
    at StaticContainer (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:137779:17)
    at EnsureSingleNavigator (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:133551:24)
    at SceneView (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:137684:22)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:63054:43)
    at DebugContainer (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:139600:36)
    at MaybeNestedStack (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:132109:23)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:63054:43)
    at RNSScreen
    at Animated(Anonymous) (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:80091:62)
    at Suspender (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:142171:22)
    at Suspense
    at Freeze (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:142181:23)
    at DelayedFreeze (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:142135:22)
    at InnerScreen (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:141955:36)
    at Screen (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:142097:36)
    at SceneView (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:132153:22)
    at Suspender (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:142171:22)
    at Suspense
    at Freeze (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:142181:23)
    at DelayedFreeze (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:142135:22)
    at RNSScreenStack
    at ScreenStack (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:142462:25)
    at NativeStackViewInner (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:132351:22)
    at RNCSafeAreaProvider
    at SafeAreaProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:140499:24)
    at SafeAreaProviderCompat (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:141276:24)
    at NativeStackView
    at PreventRemoveProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:136643:25)
    at NavigationContent (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:137470:22)
    at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:137486:27)
    at NativeStackNavigator (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:132042:18)
    at EnsureSingleNavigator (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:133551:24)
    at BaseNavigationContainer (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:133147:28)
    at ThemeProvider (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:138999:21)
    at NavigationContainerInner (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:138887:26)
    at App
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:63054:43)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:63054:43)
    at AppContainer (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:62927:25)
    at react_native_sample_app(RootComponent) (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.service.apps.rnsample:116986:28)

Can you reproduce the bug?

Always

Reproduction Steps

- How to reproduce for errors

  1. Run the git clone git clone https://github.com/wisdomstar94/react_native_sample_app.git
  2. Move Terminal to Cloned Project cd react_native_sample_app
  3. checkout branch git checkout realmjs-issue
  4. npm install npm i
  5. Move to the terminal folder cd ./ios
  6. Run the pod install command as shown below to activate the new architecture of "react native" bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install (Source of the above command : https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-apps.md#enable-new-architecture-for-ios)
  7. When the ios emulator is ready, run the ios app using the command below. npm run ios
  8. When the app is installed in the emulator, the following error is displayed after a while. image


- Without a new architecture, errors will not occur.

  1. pod install
  2. npm run ios image

Version

12.7.1

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Mac M1 14.4.1

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

sync-by-unito[bot] commented 2 weeks ago

➤ PM Bot commented:

Jira ticket: RJS-2811

wisdomstar94 commented 2 weeks ago

I think I need to check it again, so I'll close the issue for now.

wisdomstar94 commented 2 weeks ago

Fixed the error reproduction process. Reopen the issue.

kraenhansen commented 2 weeks ago

Thanks for creating the issue. We do test with the new arch enabled: https://github.com/realm/realm-js/blob/a5e797c802a971bdd1112b95ef8be215186c1f9b/integration-tests/environments/react-native-test-app/package.json#L105-L108

I've just rebased my branch upgrading our test app to 0.74.0 🤞 https://github.com/realm/realm-js/pull/6636

kraenhansen commented 2 weeks ago

I'm reproducing https://github.com/react-native-maps/react-native-maps/issues/5042 when running our React Native 0.74.0 branch locally 👀 and the stack doesn't seem related to Realm.

wisdomstar94 commented 2 weeks ago

I'm reproducing react-native-maps/react-native-maps#5042 when running our React Native 0.74.0 branch locally 👀 and the stack doesn't seem related to Realm.

@kraenhansen Is my issue related to that issue you mentioned? I feel like that issue has suddenly been mentioned.

kraenhansen commented 2 weeks ago

Is my issue related to that issue you mentioned?

Not directly, but I wanted to share my progress trying to run our library with RCT_NEW_ARCH_ENABLED=1 and React Native 0.74.0 to share that I'm not even able to get our integration test app to the point that you are.

wisdomstar94 commented 2 weeks ago

@kraenhansen

I may have misunderstood it because I'm interpreting it while using a translator, To sum up, what you mean is that the issue I posted may not be a matter of realm?

kraenhansen commented 1 week ago

I think we do have an issue, but I was unable to test it using our integration tests because we use React Native Test App which has an issue https://github.com/microsoft/react-native-test-app/issues/2015.

I'll report back as I learn more.

kraenhansen commented 1 week ago

We don't support bridgeless on iOS and I've created https://github.com/realm/realm-js/issues/6653 to track this 👍

wisdomstar94 commented 1 week ago

@kraenhansen

Thank you for checking.

ArindamRayMukherjee commented 1 week ago

For whomever stumbles upon this in the near future, reinstating the bridge helps for iOS See https://github.com/reactwg/react-native-new-architecture/discussions/174 and the "Opting-out of Bridgeless" section