mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.56k stars 1.1k forks source link

🔧 undefined symbol: RNWorklet::JsiWorkletContext #2552

Closed tomerh2001 closed 9 months ago

tomerh2001 commented 9 months ago

How were you trying to build the app?

yarn start

Full build logs

ld: error: undefined symbol: typeinfo for RNWorklet::JsiHostObject       
  >>> referenced by JVisionCameraProxy.cpp
  >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(typeinfo for RNWorklet::JsiWorklet)
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.

  C++ build system [build] failed while executing:
      @echo off
      "C:\\Users\\tomer\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
        -C ^
        "C:\\3\\node_modules\\react-native-vision-camera\\android\\.cxx\\Debug\\35e3p6m3\\arm64-v8a" ^
        VisionCamera
    from C:\3\node_modules\react-native-vision-camera\android

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 5m 58s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installEnvStageDebug -PreactNativeDevServerPort=8081 -PreactNativeDebugArchitectures=arm64-v8a -PreactNativeArchitectures=arm64-v8a
android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:3018:18: warning: the variable "DebuggerInternal" was not declared in function "__shouldPauseOnThrow" typeof DebuggerInternal !== 'undefined' && ^~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:6676:7: warning: the variable "setTimeout" was not declared in function "logCapturedError" setTimeout(function () { ^~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:4645:108: warning: the variable "nativeFabricUIManager" was not declared in function "onChange" ...lInstanceHandle ? (from && nativeFabricUIManager.setIsJSResponder(from.sta... ^~~~~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:5257:21: warning: the variable "clearTimeout" was not declared in anonymous function " 150#" cancelTimeout = clearTimeout; ^~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:9007:30: warning: the variable "__REACT_DEVTOOLS_GLOBAL_HOOK__" was not declared in anonymous function " 150#" if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:11376:5: warning: the variable "setImmediate" was not declared in function "handleResolved" setImmediate(function () { ^~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15660:12: warning: the variable "fetch" was not declared in anonymous function " 387#" fetch: fetch, ^~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15661:14: warning: the variable "Headers" was not declared in anonymous function " 387#" Headers: Headers, ^~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15662:14: warning: the variable "Request" was not declared in anonymous function " 387#" Request: Request, ^~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15663:15: warning: the variable "Response" was not declared in anonymous function " 387#" Response: Response ^~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15820:24: warning: the variable "FileReader" was not declared in function "readBlobAsArrayBuffer" var reader = new FileReader(); ^~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15871:36: warning: the variable "Blob" was not declared in anonymous function " 398#" } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15873:40: warning: the variable "FormData" was not declared in anonymous function " 398#" } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { ^~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15875:44: warning: the variable "URLSearchParams" was not declared in anonymous function " 398#" ...e if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body... ^~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15994:26: warning: the variable "AbortController" was not declared in anonymous function " 404#" var ctrl = new AbortController(); ^~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:16128:23: warning: the variable "XMLHttpRequest" was not declared in anonymous function " 408#" var xhr = new XMLHttpRequest(); ^~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15673:71: warning: the variable "self" was not declared in anonymous function " 390#" ...undefined' && globalThis || typeof self !== 'undefined' && self || ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:25908:27: warning: the variable "performance" was not declared in anonymous function " 675#" if ("object" === typeof performance && "function" === typeof performance.no... ^~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:25931:26: warning: the variable "navigator" was not declared in anonymous function " 675#" "undefined" !== typeof navigator && undefined !== navigator.scheduling && u... ^~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:26041:37: warning: the variable "MessageChannel" was not declared in anonymous function " 675#" };else if ("undefined" !== typeof MessageChannel) { ^~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:26056:34: warning: the variable "nativeRuntimeScheduler" was not declared in anonymous function " 675#" ... = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.... ^~~~~~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:35322:34: warning: the variable "requestAnimationFrame" was not declared in function "start 9#" ... this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); ^~~~~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:60780:76: warning: the variable "Buffer" was not declared in function "convertValue" ... 'function' ? new Blob([value]) : Buffer.from(value); ^~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:62017:56: warning: the variable "btoa" was not declared in function "dispatchXhrRequest" ...rs.set('Authorization', 'Basic ' + btoa(username + ':' + password)); ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:63733:31: warning: the variable "atob" was not declared in function "b64DecodeUnicode" return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) { ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:63911:16: warning: the variable "bootstrap" was not declared in anonymous function " 1681#" if (typeof bootstrap === "function") { ^~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:63923:23: warning: the variable "ses" was not declared in anonymous function " 1681#" } else if (typeof ses !== "undefined") { ^~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:65078:22: warning: the variable "StopIteration" was not declared in function "continuer" if (typeof StopIteration === "undefined") { ^~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:64206:16: warning: the variable "ReturnValue" was not declared in anonymous function " 1683#" if (typeof ReturnValue !== "undefined") { ^~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:170434:31: warning: the variable "normalizeDigits" was not declared in function "checkNumberGroupingIsValid" var normalizedCandidate = normalizeDigits(candidate, true ^~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:170441:28: warning: the variable "MetadataManager" was not declared in function "checkNumberGroupingIsValid" var alternateFormats = MetadataManager.getAlternateFormatsForCountry(numb... ^~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:170442:37: warning: the variable "util" was not declared in function "checkNumberGroupingIsValid" var nationalSignificantNumber = util.getNationalSignificantNumber(number); ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:170476:25: warning: the variable "formatNumber" was not declared in function "getNationalNumberGroups" var rfc3966Format = formatNumber(number, 'RFC3966', metadata); // We remo... ^~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:170489:53: warning: the variable "NON_DIGITS_PATTERN" was not declared in function "allNumberGroupsAreExactlyPresent" ...= normalizedCandidate.split(NON_DIGITS_PATTERN); // Set this to the last g... ^~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:170515:43: warning: the variable "CountryCodeSource" was not declared in function "allNumberGroupsRemainGrouped" ...r.getCountryCodeSource() !== CountryCodeSource.FROM_DEFAULT_COUNTRY) { ^~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:170537:65: warning: the variable "Character" was not declared in function "allNumberGroupsRemainGrouped" ...rRegion(region, true) != null && Character.isDigit(normalizedCandidate.cha... ^~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:175901:51: warning: the variable "FileList" was not declared in function "c" ... instanceof Blob || e instanceof FileList) || !r && !i(e)) return e; ^~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:176256:77: warning: the variable "HTMLElement" was not declared in function "X" ...w ? t.defaultView.HTMLElement : HTMLElement); ^~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:222610:32: warning: the variable "crypto" was not declared in function "rng" getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValu... ^~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:227122:42: warning: the variable "Element" was not declared in function "equal" ...f (hasElementType && a instanceof Element && b instanceof Element) return ... ^~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:242110:37: warning: the variable "SC_DISABLE_SPEEDY" was not declared in anonymous function " 5713#" ... Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "unde... ^~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:242180:37: warning: the variable "__webpack_nonce__" was not declared in function "B 5#" ...ar i = "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : null; ^~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:247066:25: warning: the variable "URL" was not declared in function "origin" fromUrl = new URL(from.source, this.map.consumer().sourceRoot || _$... ^~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:260348:20: warning: the variable "WeakRef" was not declared in anonymous function " 6416#" var Ref = typeof WeakRef !== "undefined" ? WeakRef : StrongRef; ^~~~~~~ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\3\node_modules\@react-native-clipboard\clipboard\android\src\main\java\com\reactnativecommunity\clipboard\ClipboardPackage.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\3\node_modules\react-native-fast-tflite\android\src\main\java\com\tflite\TfliteModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\3\node_modules\react-native-flipper\android\src\debug\java\com\facebook\flipper\reactnative\FlipperModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\3\node_modules\react-native-sensitive-info\android\src\main\java\br\com\classapp\RNSensitiveInfo\RNSensitiveInfoModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\3\node_modules\react-native-ssl-pinning\android\src\main\java\com\toyberman\Utils\OkHttpUtils.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. C:\3\node_modules\react-native-svg\android\src\main\java\com\horcrux\svg\RNSVGRenderableManager.java:11: warning: [removal] StandardCharsets in com.facebook.react.common has been deprecated and marked for removal import static com.facebook.react.common.StandardCharsets.UTF_8; ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 warning Note: C:\3\node_modules\react-native-safe-area-context\android\src\paper\java\com\th3rdwave\safeareacontext\NativeSafeAreaContextSpec.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-vision-camera:buildCMakeDebug[arm64-v8a]'. > com.android.ide.common.process.ProcessException: ninja: Entering directory `C:\3\node_modules\react-native-vision-camera\android\.cxx\Debug\35e3p6m3\arm64-v8a' [1/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/PassThroughShader.cpp.o [2/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLContext.cpp.o [3/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessorPlugin.cpp.o [4/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrame.cpp.o [5/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLRenderer.cpp.o [6/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/MutableJByteBuffer.cpp.o C:/3/node_modules/react-native-vision-camera/android/src/main/cpp/MutableJByteBuffer.cpp:17:21: warning: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch] MutableJByteBuffer::~MutableJByteBuffer() noexcept { ^ C:/3/node_modules/react-native-vision-camera/android/src/main/cpp/MutableJByteBuffer.h:22:3: note: previous declaration is here ~MutableJByteBuffer(); ^ 1 warning generated. [7/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameProcessorPluginHostObject.cpp.o [8/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o [9/18] Building CXX object CMakeFiles/VisionCamera.dir/C_/3/node_modules/react-native-vision-camera/cpp/MutableRawBuffer.cpp.o [10/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VideoPipeline.cpp.o [11/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameHostObject.cpp.o [12/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp.o C:/3/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp:37:90: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat] __android_log_print(ANDROID_LOG_INFO, TAG, "Wrapping Java ByteBuffer with size %i...", byteBuffer->getDirectSize()); ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~ %zu 1 warning generated. [13/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp.o [14/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/VisionCameraProxy.cpp.o [15/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/JSIJNIConversion.cpp.o [16/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o [17/18] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o [18/18] Linking CXX shared library ..\..\..\..\build\intermediates\cxx\Debug\35e3p6m3\obj\arm64-v8a\libVisionCamera.so FAILED: ../../../../build/intermediates/cxx/Debug/35e3p6m3/obj/arm64-v8a/libVisionCamera.so cmd.exe /C "cd . && C:\Users\tomer\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android26 --sysroot=C:/Users/tomer/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all -g -fno-limit-debug-info -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Qunused-arguments -Wl,--no-undefined -shared -Wl,-soname,libVisionCamera.so -o ..\..\..\..\build\intermediates\cxx\Debug\35e3p6m3\obj\arm64-v8a\libVisionCamera.so CMakeFiles/VisionCamera.dir/C_/3/node_modules/react-native-vision-camera/cpp/MutableRawBuffer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/VideoPipeline.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/PassThroughShader.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLContext.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLRenderer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/MutableJByteBuffer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameHostObject.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameProcessorPluginHostObject.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/JSIJNIConversion.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/VisionCameraProxy.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrame.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessorPlugin.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp.o C:/Users/tomer/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/26/liblog.so -landroid C:/Users/tomer/.gradle/caches/transforms-3/113fe422dce7132f3cecffc92c85da74/transformed/jetified-react-android-0.73.4-debug/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so C:/Users/tomer/.gradle/caches/transforms-3/113fe422dce7132f3cecffc92c85da74/transformed/jetified-react-android-0.73.4-debug/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so C:/Users/tomer/.gradle/caches/transforms-3/8411529ddc209f536fefb997b7d84d69/transformed/jetified-fbjni-0.5.1/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so -lGLESv2 -lEGL -latomic -lm && cd ." ld: error: undefined symbol: RNWorklet::JsiWorkletContext::getWorkletRuntime() >>> referenced by JVisionCameraProxy.h:42 (C:/3/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings\JVisionCameraProxy.h:42) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp.o:(vision::JSharedArray::JSharedArray(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JSharedArray, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraProxy, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jni::alias_ref<facebook::jni::JByteBuffer>)) >>> referenced by JFrameProcessor.cpp:37 (C:/3/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings\JFrameProcessor.cpp:37) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(vision::JFrameProcessor::callWithFrameHostObject(std::__ndk1::shared_ptr<vision::FrameHostObject> const&) const) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::runtimeMappings >>> referenced by __tree:0 (C:/Users/tomer/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\__tree:0) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)) >>> referenced by __tree:0 (C:/Users/tomer/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\__tree:0) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnWorkletThread(std::__ndk1::function<void (RNWorklet::JsiWorkletContext*, facebook::jsi::Runtime&)>&&) >>> referenced by WKTJsiWorklet.h:372 (C:/3/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:372) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::~WorkletInvoker()) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnJsThread(std::__ndk1::function<void (facebook::jsi::Runtime&)>&&) >>> referenced by WKTJsiWorklet.h:369 (C:/3/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:369) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::~WorkletInvoker()) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::defaultInstance >>> referenced by memory:3887 (C:/Users/tomer/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\memory:3887) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) >>> referenced by memory:3887 (C:/Users/tomer/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\memory:3887) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) ld: error: undefined symbol: RNWorklet::JsiHostObject::JsiHostObject() >>> referenced by WKTJsiWorkletContext.h:31 (C:/3/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) >>> referenced by WKTJsiWorklet.h:77 (C:/3/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:77) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&)) ld: error: undefined symbol: vtable for RNWorklet::JsiWorkletContext >>> referenced by WKTJsiWorkletContext.h:31 (C:/3/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) >>> referenced by WKTJsiWorkletContext.h:31 (C:/3/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::~JsiWorkletContext() >>> referenced by memory:2252 (C:/Users/tomer/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\memory:2252) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(std::__ndk1::__shared_ptr_emplace<RNWorklet::JsiWorkletContext, std::__ndk1::allocator<RNWorklet::JsiWorkletContext> >::~__shared_ptr_emplace()) >>> referenced by memory:2252 (C:/Users/tomer/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\memory:2252) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(std::__ndk1::__shared_ptr_emplace<RNWorklet::JsiWorkletContext, std::__ndk1::allocator<RNWorklet::JsiWorkletContext> >::~__shared_ptr_emplace()) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::JsiWorkletContext(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, facebook::jsi::Runtime*, std::__ndk1::function<void (std::__ndk1::function<void ()>&&)>, std::__ndk1::function<void (std::__ndk1::function<void ()>&&)>) >>> referenced by memory:2278 (C:/Users/tomer/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\memory:2278) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vision::JVisionCameraProxy::JVisionCameraProxy(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraProxy, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jsi::Runtime*, std::__ndk1::shared_ptr<facebook::react::CallInvoker> const&, facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, facebook::jni::GlobalReferenceAllocator> const&)) ld: error: undefined symbol: RNWorklet::JsiHostObject::~JsiHostObject() >>> referenced by WKTJsiWorklet.h:79 (C:/3/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:79) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&)) >>> referenced by WKTJsiWorklet.h:74 (C:/3/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:74) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::~JsiWorklet()) ld: error: undefined symbol: RNWorklet::JsiWrapper::wrap(facebook::jsi::Runtime&, facebook::jsi::Value const&, RNWorklet::JsiWrapper*) >>> referenced by WKTJsiWrapper.h:62 (C:/3/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWrapper.h:62) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::createWorklet(facebook::jsi::Runtime&, std::__ndk1::shared_ptr<facebook::jsi::Function>)) ld: error: undefined symbol: RNWorklet::JsiHostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&) >>> referenced by JVisionCameraProxy.cpp >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet) ld: error: undefined symbol: RNWorklet::JsiHostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&) >>> referenced by JVisionCameraProxy.cpp >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet) ld: error: undefined symbol: RNWorklet::JsiHostObject::getPropertyNames(facebook::jsi::Runtime&) >>> referenced by JVisionCameraProxy.cpp >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet) ld: error: undefined symbol: typeinfo for RNWorklet::JsiHostObject >>> referenced by JVisionCameraProxy.cpp >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(typeinfo for RNWorklet::JsiWorklet) clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. C++ build system [build] failed while executing: @echo off "C:\\Users\\tomer\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^ -C ^ "C:\\3\\node_modules\\react-native-vision-camera\\android\\.cxx\\Debug\\35e3p6m3\\arm64-v8a" ^ VisionCamera from C:\3\node_modules\react-native-vision-camera\android * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 5m 58s.
info Run CLI with --verbose flag for more details.

### Project dependencies

```json
"dependencies": {
    "@ismaelmoreiraa/vision-camera-ocr": "^2.2.3",
    "@react-native-clipboard/clipboard": "^1.13.2",
    "@react-native-picker/picker": "^2.6.1",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/stack": "^6.3.20",
    "@reduxjs/toolkit": "^2.1.0",
    "@types/jwt-decode": "^3.1.0",
    "axios": "^1.6.7",
    "base-64": "^1.0.0",
    "dotenv": "^16.4.1",
    "formik": "^2.4.5",
    "jwt-decode": "^4.0.0",
    "libphonenumber-js": "^1.10.55",
    "metro-react-native-babel-preset": "^0.77.0",
    "moment": "^2.30.1",
    "postcss": "^8.4.34",
    "react": "18.2.0",
    "react-hook-form": "^7.50.0",
    "react-native": "0.73.4",
    "react-native-autocomplete-dropdown": "^3.1.3",
    "react-native-blob-util": "^0.19.6",
    "react-native-config": "^1.5.1",
    "react-native-date-picker": "^4.3.5",
    "react-native-device-info": "^10.12.0",
    "react-native-fast-tflite": "^1.1.3",
    "react-native-flipper": "^0.212.0",
    "react-native-gesture-handler": "^2.15.0",
    "react-native-get-random-values": "^1.10.0",
    "react-native-indicators": "^0.17.0",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-otp-verify": "^1.1.6",
    "react-native-pager-view": "^6.2.3",
    "react-native-paper": "^5.12.3",
    "react-native-picker-select": "^9.0.1",
    "react-native-safe-area-context": "^4.9.0",
    "react-native-section-alphabet-list": "^3.0.0",
    "react-native-select-contact": "^1.6.3",
    "react-native-sensitive-info": "^5.5.8",
    "react-native-shapes": "^0.1.0",
    "react-native-sms-retriever": "^1.1.1",
    "react-native-splash-screen": "^3.3.0",
    "react-native-ssl-pinning": "^1.5.7",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "^14.1.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-table-component": "^1.2.2",
    "react-native-vector-icons": "^10.0.3",
    "react-native-vision-camera": "^3.9.0-beta.3",
    "react-native-webview": "^13.7.1",
    "react-native-worklets-core": "^0.3.0",
    "react-redux": "^9.1.0",
    "react-xml-parser": "1.1.8",
    "redux": "^5.0.1",
    "redux-thunk": "^3.1.0",
    "styled-components": "^6.1.8",
    "uuid": "^9.0.1",
    "vision-camera-resize-plugin": "^2.0.1",
    "yup": "^1.3.3"
  },
  "devDependencies": {
    "@babel/core": "^7.23.9",
    "@babel/preset-env": "^7.23.9",
    "@babel/runtime": "^7.23.9",
    "@react-native/babel-preset": "0.73.21",
    "@react-native/eslint-config": "0.73.2",
    "@react-native/metro-config": "0.73.5",
    "@react-native/typescript-config": "0.74.0",
    "@semantic-release/changelog": "^6.0.3",
    "@semantic-release/commit-analyzer": "^11.1.0",
    "@semantic-release/git": "^10.0.1",
    "@semantic-release/npm": "^11.0.2",
    "@semantic-release/release-notes-generator": "^12.1.0",
    "@types/base-64": "^1.0.2",
    "@types/react": "^18.2.55",
    "@types/react-native-get-random-values": "^1.8.2",
    "@types/react-native-indicators": "^0.16.6",
    "@types/react-native-table-component": "^1.2.8",
    "@types/react-test-renderer": "^18.0.7",
    "@types/uuid": "^9.0.8",
    "@types/xo": "^0.39.8",
    "babel-jest": "^29.7.0",
    "eslint": "^8.56.0",
    "jest": "^29.7.0",
    "prettier": "3.2.5",
    "react-native-dotenv": "^3.4.10",
    "react-test-renderer": "18.2.0",
    "semantic-release": "^23.0.2",
    "typescript": "5.3.3",
    "xo": "^0.57.0"
  },


### VisionCamera Version

^3.9.0-beta.3 (also tried latest stable 3.8.2 I think)

### Target platforms

Android

### Operating system

Windows

### Can you build the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

### Additional information

- [ ] I am using Expo
- [X] I have enabled Frame Processors (react-native-worklets-core)
- [X] I have read the [Troubleshooting Guide](https://react-native-vision-camera.com/docs/guides/troubleshooting)
- [X] I agree to follow this project's [Code of Conduct](https://github.com/mrousavy/react-native-vision-camera/blob/main/CODE_OF_CONDUCT.md)
- [X] I searched for [similar issues in this repository](https://github.com/mrousavy/react-native-vision-camera/issues) and found none.
tomerh2001 commented 9 months ago

Fixed by clearing cache. This can be closed.

jdnichollsc commented 8 months ago

@tomerh2001 how did you clean the cache mate? 🤔 I already reinstalled npm packages, executed npm cache clean --force and deleted the build android folders and nothing works :/

johnernest02-automanager commented 7 months ago

@jdnichollsc Were you able to clean your cache?

XuanChuYun commented 7 months ago

Build-> Clean Project,This can be closed.

qispark commented 6 months ago

I want to report that I am still replicating the error in my production builds. Even after clearing cache only, I have experienced this issue on a regular basis.

My environment:

OS: Mac M1
"react-native": "0.73.6",
"react-native-vision-camera": "^4.0.3",
"react-native-worklets-core": "^1.3.3",

I've also read through the other reports of this (e.g. #2511 #2418 #2290 #2286)

A Temporary Workaround

This has worked for me:

However I think this is only good for a workaround.

Clues

I have spent a day investigating the build process. By comparing the entire directories of successful builds and failed builds, I have found the following:

Not working:

if(NOT TARGET react-native-worklets-core::rnworklets)
add_library(react-native-worklets-core::rnworklets INTERFACE IMPORTED)
set_target_properties(react-native-worklets-core::rnworklets PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "{PROJECT_DIR}/node_modules/react-native-worklets-core/android/build/headers/rnworklets"
    INTERFACE_LINK_LIBRARIES ""
)
endif()

Working:

if(NOT TARGET react-native-worklets-core::rnworklets)
add_library(react-native-worklets-core::rnworklets SHARED IMPORTED)
set_target_properties(react-native-worklets-core::rnworklets PROPERTIES
    IMPORTED_LOCATION "{PROJECT_DIR}/node_modules/react-native-worklets-core/android/build/intermediates/cxx/RelWithDebInfo/322qv2c4/obj/arm64-v8a/librnworklets.so"
    INTERFACE_INCLUDE_DIRECTORIES "{PROJECT_DIR}/node_modules/react-native-worklets-core/android/build/headers/rnworklets"
    INTERFACE_LINK_LIBRARIES ""
)
endif()

/react-native-vision-camera/android/.cxx/RelWithDebInfo/2m415h14/arm64-v8a/android_gradle_build.json:

Not working:

...
  "libraries": {
    "VisionCamera::@6890427a1f51a3e7e1df": {
      "toolchain": "toolchain",
      "abi": "arm64-v8a",
      "artifactName": "VisionCamera",
      "output": "{PROJECT_DIR}/node_modules/react-native-vision-camera/android/build/intermediates/cxx/RelWithDebInfo/2m415h14/obj/arm64-v8a/libVisionCamera.so",
      "runtimeFiles": [
        "~/.gradle/caches/transforms-3/b89c75dfebd78a0b3752403ce5c7230e/transformed/jetified-react-android-0.73.6-release/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so",
        "~/.gradle/caches/transforms-3/b89c75dfebd78a0b3752403ce5c7230e/transformed/jetified-react-android-0.73.6-release/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so",
        "~/.gradle/caches/transforms-3/228d163c1ef1c5981a4c5ae46d013f7c/transformed/jetified-fbjni-0.5.1/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so"
      ]
    }
  },
...

Working:

...
  "libraries": {
    "VisionCamera::@6890427a1f51a3e7e1df": {
      "toolchain": "toolchain",
      "abi": "arm64-v8a",
      "artifactName": "VisionCamera",
      "output": "{PROJECT_DIR}/node_modules/react-native-vision-camera/android/build/intermediates/cxx/RelWithDebInfo/2m415h14/obj/arm64-v8a/libVisionCamera.so",
      "runtimeFiles": [
        "~/.gradle/caches/transforms-3/b89c75dfebd78a0b3752403ce5c7230e/transformed/jetified-react-android-0.73.6-release/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so",
        "~/.gradle/caches/transforms-3/b89c75dfebd78a0b3752403ce5c7230e/transformed/jetified-react-android-0.73.6-release/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so",
        "~/.gradle/caches/transforms-3/228d163c1ef1c5981a4c5ae46d013f7c/transformed/jetified-fbjni-0.5.1/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so",
        "{PROJECT_DIR}/node_modules/react-native-worklets-core/android/build/intermediates/cxx/RelWithDebInfo/322qv2c4/obj/arm64-v8a/librnworklets.so"
      ]
    }
  },
...

(have replaced home and project directory with ~ and {PROJECT_DIR} in above snippets for privacy)

The above file differences may only be the side effect of how this is happening. Unfortunately I'm not so familiar with the build process, but perhaps someone who is more knowledgeable about this could shed a light into why this might be happening?

Other things I have attempted but not worked:

eisodev commented 5 months ago

Add this script to your package.json under scripts:

"clean": "rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean --force && rm -rf android/.gradle android/.idea android/app/build android/build && rm -rf node_modules"

Usually solves the problem:

BUILD FAILED in 17s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':react-native-vision-camera:buildCMakeDebug[arm64-v8a]
e-nouri commented 4 months ago

This issue still happens, clearing the cache and removing node_modules when xcode is running is not really a solution.