react-native-mmkv: dlopen: failed to load __emutls_get_address

It seems it requires __emutls_get_address function to be defined, and although it’s usually provided by libc++_shared.so, it does not seem to be the case when using NDK 24 on an Apple M1 CPU.

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 88.38 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - /opt/homebrew/opt/node@18/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - /opt/homebrew/opt/node@18/bin/npm
    Watchman: 2022.11.28.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK: Not Found
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8815526
    Xcode: /undefined - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: ^9.3.2 => 9.3.2
    react: ~18.1.0 => 18.1.0
    react-native: ~0.70.4 => 0.70.6
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
$ echo $ANDROID_HOME
/Users/volgar1x/Library/Android/sdk
$ ls $ANDROID_HOME/ndk
24.0.8215888

It seems to be building just fine on a Fedora desktop with the same dependencies but with an older NDK (21.4.7075529).

See https://github.com/facebook/react-native/issues/35324

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Finally I have succeeded: It works only with ndkVersion = “21.4.7075529” Versions 23.1.7779620, 24.0.8215888 and 25.1.8937393 doesn’t work

I can also confirm that ndk “23.1.7779620” breaks mmkv, and switching back to “21.4.7075529” fixed this issue the weird thing is that it builds and works properly locally (I’m using windows), but not on github workflow using cimg/android:2022.08.1-ndk container image