C++17 function cannot be found by dependency used in React Native 0.73.5 on Android

59 Views Asked by At

While using a maven dependency (https://github.com/Governikus/AusweisApp) that internally uses libQt6 in an Android React Native 0.73.5 project, the App crashes with the following stacktrace:

FATAL EXCEPTION: qtMainLoopThread
 Process: com.aa2test2:ausweisapp2_service, PID: 9904
 java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZTVNSt6__ndk13pmr25monotonic_buffer_resourceE" referenced by "/data/app/~~C4l_mRmUqYPFB7K9Bn86PA==/com.aa2test2-k8yOUFZGiJUstsUM1QUl1A==/lib/arm64/libQt6Core_arm64-v8a.so"...
 at java.lang.Runtime.load0(Runtime.java:929)
 at java.lang.System.load(System.java:1625)
 at org.qtproject.qt.android.QtNative$2.run(QtNative.java:235)
 at org.qtproject.qt.android.QtThread$2.run(QtThread.java:51)
 at org.qtproject.qt.android.QtThread$1.run(QtThread.java:25)
 at java.lang.Thread.run(Thread.java:1012)

To reproduce the issue, I created a React Native project from scratch with only this dependency included. Therefore i am certain, that there is no other dependency interfering.

As the mentioned monotonic_buffer_resourceE symbol seems to be a C++17 function (https://en.cppreference.com/w/cpp/memory/monotonic_buffer_resource) my theory is that the libc++ included does not provide C++17 std functions. I already checked the NDK version that is configured in the build.gradle which is "25.1.8937393" and should be fine.

How can i check the C++ Version of the included libc++ in my Android build? Do i have to configure anything else except the NDK? What am i doing wrong here?

Here a repository for a reproducer: https://github.com/milanpro/AA2_issue_reproducer

0

There are 0 best solutions below