realm / realm-js

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

[Solved] Error: Exception in HostObject::get for prop 'Realm': java.lang.UnsatisfiedLinkError: couldn't find DSO to load: librealm.so caused by: dlopen failed: cannot locate symbol "__emutls_get_address" #5361

Closed michelorthcba closed 1 year ago

michelorthcba commented 1 year ago

How frequently does the bug occur?

Always

Description

when trying to launch my application I get the following error:

ERROR Error: Exception in HostObject::get for prop 'Realm': java.lang.UnsatisfiedLinkError: couldn't find DSO to load: librealm.so caused by: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/ app/~~TV6qv1qy_a_BYXgZTHBqTw==/br.com.xxxx-Ja5z9s0oS8KVtSZWf6nQ8Q==/lib/arm/librealm.so"... result: 0, js engine: hermes

ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

This happened after I migrated from react-native 0.68.2 to 0.68.5

this is my package.json

{ "name": "xxxx", "version": "0.0.1", "private": true, "scripts": { "start": "react-native start", "test": "jest", "test:update": "jest -u", "test:coverage": "jest --coverage", "run:ios": "react-native run-ios", "run:android": "react-native run-android", "lint": "./node_modules/eslint/bin/eslint.js src", "lint:fix": "./node_modules/eslint/bin/eslint.js src --fix", "flow": "./node_modules/flow-bin/cli.js", "e2e:build": "detox build --configuration ios.sim.debug", "e2e:test": "detox test --configuration ios.sim.debug", "postinstall": "npx jetify" }, "dependencies": { "@babel/helper-hoist-variables": "^7.18.6", "@expo/react-native-action-sheet": "^3.13.0", "@react-native-community/art": "^1.2.0", "@react-native-community/async-storage": "^1.12.1", "@react-native-community/datetimepicker": "^6.3.1", "@react-native-community/netinfo": "^9.3.0", "@react-native-community/push-notification-ios": "^1.10.1", "@react-native-picker/picker": "^2.4.2", "@react-navigation/bottom-tabs": "^5.11.11", "@react-navigation/drawer": "^5.12.5", "@react-navigation/native": "^5.9.4", "@react-navigation/routers": "^5.7.4", "@react-navigation/stack": "^5.14.5", "axios": "^0.27.2", "base-64": "^1.0.0", "date-fns": "^2.28.0", "formik": "^2.2.9", "jetifier": "^2.0.0", "lodash": "^4.17.21", "moment": "^2.29.4", "pdf-lib": "^1.17.1", "react": "17.0.2", "react-native": "0.68.5", "react-native-blob-util": "^0.16.2", "react-native-calendars": "^1.1285.0", "react-native-device-info": "^10.0.1", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.5.0", "react-native-image-picker": "^4.8.4", "react-native-linear-gradient": "^2.6.2", "react-native-location": "^2.5.0", "react-native-maps": "^1.1.0", "react-native-mock-location-detector": "^2.0.0", "react-native-modal": "^13.0.1", "react-native-modal-datetime-picker": "^13.1.2", "react-native-modal-dropdown": "^1.0.2", "react-native-multiple-select": "^0.5.9", "react-native-paper": "^4.12.2", "react-native-pdf": "^6.6.2", "react-native-progress-steps": "^1.3.4", "react-native-push-notification": "^8.1.1", "react-native-rate": "^1.2.9", "react-native-ratings": "^8.1.0", "react-native-reanimated": "^2.9.1", "react-native-render-html": "^6.3.4", "react-native-responsive-screen": "^1.4.2", "react-native-safe-area-context": "^4.3.1", "react-native-screens": "^3.15.0", "react-native-share": "^7.6.6", "react-native-signature-canvas": "^4.4.1", "react-native-svg": "^12.4.4", "react-native-ui-lib": "^6.18.0", "react-native-vector-icons": "^9.2.0", "react-native-vision-camera": "^2.14.0", "react-native-webview": "^11.22.7", "react-redux": "^8.0.2", "realm": "^11.0.0-rc.0", "recompose": "^0.30.0", "redux": "^4.2.0", "redux-logger": "^3.0.6", "redux-persist": "^6.0.0", "redux-promise": "^0.6.0", "redux-thunk": "^2.4.1", "vanilla-masker": "^1.2.0", "vision-camera-face-detector": "^0.1.8", "yup": "^0.32.11" }, "devDependencies": { "@babel/core": "^7.18.6", "@babel/runtime": "^7.18.6", "@react-native-community/eslint-config": "^3.0.3", "babel-jest": "^28.1.2", "babel-plugin-module-resolver": "^4.1.0", "eslint": "^8.19.0", "jest": "^28.1.2", "metro-react-native-babel-preset": "^0.71.3", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } }

Stacktrace & log output

ERROR Error: Exception in HostObject::get for prop 'Realm': java.lang.UnsatisfiedLinkError: couldn't find DSO to load: librealm.so caused by: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/ app/~~TV6qv1qy_a_BYXgZTHBqTw==/br.com.xxxx-Ja5z9s0oS8KVtSZWf6nQ8Q==/lib/arm/librealm.so"... result: 0, js engine: hermes

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

24.0.8215888

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

24.0.8215888

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

kneth commented 1 year ago

@michelorthcba I can see that you are using both Realm and Reanimated. I believe you need to upgrade to a recent version of Realm to resolve the it. The implication of upgrading Realm is that you will have to upgrade React Native too.

riebel commented 1 year ago

I have exactly the same issue with the unmodified ReactRealmTSTemplateApp on WIndows 11 Powershell (Admin):

yarn android

Error: Exception in HostObject::get(propName:Realm): java.lang.UnsatisfiedLinkError: couldn't find DSO to load: librealm.so caused by: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~MXmwL-JL43YoeCH2wVhExA==/com.riebel.ReactRealmTSTemplateApp-_MJPABB6W8OuqFEkeHnR7A==/lib/x86_64/librealm.so"... result: 0

package.json (unmodified from repo)

{ "name": "reactrealmtstemplateapp", "version": "1.0.0", "scripts": { "start": "expo start --dev-client", "android": "expo run:android", "ios": "expo run:ios" }, "dependencies": { "@realm/react": "^0.4.1", "expo": "~47.0.3", "expo-dev-client": "~2.0.0", "expo-splash-screen": "~0.17.4", "expo-status-bar": "~1.4.2", "react": "18.1.0", "react-native": "0.70.5", "react-native-get-random-values": "~1.8.0", "realm": "^11.3.1" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/plugin-proposal-decorators": "^7.19.0", "@realm/babel-plugin": "^0.1.1", "@types/react": "~18.0.14", "@types/react-native": "~0.70.6", "typescript": "~4.3.5" }, "private": true }

NoureddinAlhamwi commented 1 year ago

I have the same issue when I have upgraded react-native from 0.64.3 to 0.70.5 :(

Error: Exception in HostObject::get for prop 'Realm': java.lang.UnsatisfiedLinkError: couldn't find DSO to load: librealm.so caused by: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~x8owxLJQ0lV7w7BMu21Ruw==/MyAppName-hmV479_ViPu31TDFKKwhcQ==/lib/arm64/librealm.so"... result: 0, js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

sghagde commented 1 year ago

Same issue I am getting since last 4 days

here is package.js

{
  "name": "Test",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "postinstall": "npx jetify"
  },
  "dependencies": {
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "^6.5.5",
    "@react-native-community/geolocation": "^3.0.1",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/push-notification-ios": "^1.10.1",
    "@react-native-firebase/app": "^15.4.0",
    "@react-native-firebase/crashlytics": "^15.4.0",
    "@react-native-firebase/messaging": "^15.4.0",
    "@react-navigation/drawer": "^5.12.9",
    "@react-navigation/native": "^5.9.8",
    "@react-navigation/stack": "^5.14.9",
    "axios": "^0.27.2",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "base64-arraybuffer": "^1.0.2",
    "jsc-android": "^250230.2.1",
    "jsonschema": "^1.4.1",
    "lodash": "^4.17.21",
    "moment": "^2.29.4",
    "react": "18.1.0",
    "react-native": "0.70.7",
    "react-native-app-intro-slider": "^4.0.4",
    "react-native-chunk-upload": "^2.0.3",
    "react-native-compressor": "^1.6.1",
    "react-native-confirmation-code-field": "^7.3.0",
    "react-native-create-thumbnail": "^1.6.3",
    "react-native-device-info": "^10.1.2",
    "react-native-exit-app": "^1.1.0",
    "react-native-fast-image": "^8.6.1",
    "react-native-fs": "^2.20.0",
    "react-native-geolocation-service": "^5.3.1",
    "react-native-gesture-handler": "^2.6.0",
    "react-native-image-pan-zoom": "^2.1.12",
    "react-native-image-picker": "^4.10.0",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-keep-awake": "^4.0.0",
    "react-native-location": "^2.5.0",
    "react-native-progress": "^5.0.0",
    "react-native-push-notification": "file:lib/react-native-push-notification-master",
    "react-native-reanimated": "^2.14.4",
    "react-native-safe-area-context": "^4.3.3",
    "react-native-screens": "^3.17.0",
    "react-native-ui-lib": "^6.21.1",
    "react-native-vector-icons": "^9.2.0",
    "react-native-video": "^5.2.1",
    "react-native-video-controls": "^2.8.1",
    "react-native-view-more-text": "^2.1.0",
    "react-navigation": "^4.4.4",
    "react-redux": "^8.0.2",
    "realm": "^11.4.0",
    "reanimated-bottom-sheet": "^1.0.0-alpha.22",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.4.1",
    "rn-fetch-blob": "^0.12.0",
    "tiny-emitter": "^2.1.0",
    "url": "^0.11.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.32.0",
    "jest": "^26.6.3",
    "jetifier": "^2.0.0",
    "metro-react-native-babel-preset": "^0.72.1",
    "react-test-renderer": "18.1.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

Issue I'm facing related to realm is

ERROR Error: Exception in HostObject::get(propName:Realm): java.lang.UnsatisfiedLinkError: couldn't find DSO to load: librealm.so caused by: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~b82W3KjvQSwrYaRuzGkckQ==/com.demo.Test-yeMV_8gEbDJ09jCXVyp4fA==/lib/arm/librealm.so"... result: 0 ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

michelorthcba commented 1 year ago

@michelorthcba I can see that you are using both Realm and Reanimated. I believe you need to upgrade to a recent version of Realm to resolve the it. The implication of upgrading Realm is that you will have to upgrade React Native too.

I update from "react-native": "0.70.7" and "realm": "^11.3.1", but the error continue

proNihal commented 1 year ago

Use realm version "11.0.0" rather than "^11.0.0",

This fixed the issue for me.

michelorthcba commented 1 year ago

Use realm version "11.0.0" rather than "^11.0.0",

This fixed the issue for me.

it worked for me @proNihal

follows the changes in package.json

"realm": "11.0.0", "react-native": "0.70.7", "react": "~18.0.0", "react-dom": "^18.0.0", "react-test-renderer": "^18.0.0"

kneth commented 1 year ago

I close the issue as it sounds you have a working solution.

Pingou commented 1 year ago

@kneth Why close the issue? It seems like one of the last updates broke something. It works for me if I use 11.2.0, but not ^11.2.0.

kneth commented 1 year ago

@Pingou I assume that you haven't upgraded React Native or another dependency. Please check the compatibility matrix

Pingou commented 1 year ago

@kneth ah true, I missed that, thank you. I didn't expect a minor update to break compatibility.

kneth commented 1 year ago

@Pingou The current development of RN is a bit tough to follow for most of us. We hope to find a better solution soon (see also https://github.com/realm/realm-js/pull/4027 for a first attempt)

omarsadaka-meiladigital commented 1 year ago

for me solved by upgrading this package "react-native-reanimated" to the latest version 3.3.0

karthikeyancontus commented 9 months ago

ERROR Error: Exception in HostObject::get(propName:Realm): java.lang.UnsatisfiedLinkError: couldn't find DSO to load: librealm.so caused by: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~7bA_TH_7q2A2V1r2k0k2KA==/com.montrasampleproject-6S1QcAh1q-lRIJbF3fENuQ==/lib/arm64/librealm.so"... result: 0

still I'm getting this error for

my package.json

{ "name": "montrasampleproject", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint .", "android:clean": "cd android && ./gradlew clean && rm -rf build && cd ..", "ios:clean": "rm -rf ios/Pods/ ios/Podfile.lock ios/build && rm -rf ~/Library/Developer/Xcode/DerivedData", "file:clean": "rm -rf package-lock.json node_modules", "rn:clean": "watchman watch-del-all && npm run ios:clean && npm run file:clean", "prepare": "patch-package" }, "dependencies": { "@notifee/react-native": "^7.8.0", "@react-native-async-storage/async-storage": "^1.17.7", "@react-native-camera-roll/camera-roll": "^6.0.2", "@react-native-clipboard/clipboard": "^1.11.2", "@react-native-community/checkbox": "^0.5.16", "@react-native-community/netinfo": "^8.0.0", "@react-native-community/push-notification-ios": "^1.11.0", "@react-native-firebase/app": "^18.7.3", "@react-native-firebase/messaging": "^18.7.3", "@react-navigation/bottom-tabs": "^6.5.11", "@react-navigation/native": "^6.1.9", "@react-navigation/native-stack": "^6.9.17", "@types/react": "^18.0.24", "emoji-datasource": "^15.0.1", "expo-camera": "^13.6.0", "fbjs": "^3.0.5", "moment": "^2.29.4", "mirrorfly-uikit-react-native": "1.0.9", "native-base": "^3.4.28", "npm": "^10.2.5", "patch-package": "^8.0.0", "prop-types": "^15.8.1", "react": "17.0.2", "react-native": "0.68.5", "react-native-audio-recorder-player": "^3.6.0", "react-native-camera": "^4.2.1", "react-native-compressor": "^1.6.1", "react-native-contacts": "^7.0.8", "react-native-convert-ph-asset": "^1.0.3", "react-native-create-thumbnail": "^1.6.4", "react-native-document-picker": "^9.0.1", "react-native-file-viewer": "^2.1.5", "react-native-fs": "^2.18.0", "react-native-geocoder": "^0.5.0", "react-native-geocoding": "^0.5.0", "react-native-geolocation-service": "^5.3.1", "react-native-gesture-handler": "^2.9.0", "react-native-get-random-values": "^1.8.0", "react-native-image-crop-picker": "^0.38.0", "react-native-image-zoom-viewer": "^2.2.14", "react-native-maps": "^1.7.1", "react-native-mov-to-mp4": "^0.2.2", "react-native-pager-view": "^6.2.0", "react-native-permissions": "^3.8.0", "react-native-progress": "^5.0.0", "react-native-push-notification": "^8.1.1", "react-native-reanimated": "^3.6.1", "react-native-safe-area-context": "^4.3.1", "react-native-screens": "^3.14.1", "react-native-slider": "^0.11.0", "react-native-snap-carousel": "^3.9.1", "react-native-sound": "^0.11.0", "react-native-svg": "^13.10.0", "react-native-svg-transformer": "^1.1.0", "react-native-tab-view": "^3.5.1", "react-native-vector-icons": "^10.0.2", "react-native-video": "^5.2.1", "react-redux": "^8.0.5", "realm": "^11.0.0", "rn-fetch-blob": "^0.12.0" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "^7.32.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.67.0", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } }

proNihal commented 9 months ago

@karthikeyancontus update react-native to latest version or at least 0.72

karthikeyancontus commented 9 months ago

thanks for the immediate support @proNihal what if I have a big project in react-native 68.5

shivo-ham commented 9 months ago

if enableProguardInReleaseBuilds is enabled then disable it

karthikeyancontus commented 9 months ago

for that it's resolved with "realm": "v10.20.0-beta.1".