mrousavy / react-native-vision-camera

šŸ“ø A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.58k stars 1.1k forks source link

šŸ”§ Cannot build on Android with worklets-core #2286

Closed jslok closed 10 months ago

jslok commented 11 months ago

How were you trying to build the app?

yarn start --reset-cache

Getting an error during build when I have react-native-worklets-core installed for frame processors. If I delete and reinstall node_modules, I can build 0-2 times before the error comes back. Using an almost fresh copy of rn 0.73 with only other module being opencv for frame processor. Tried earlier versions of worklets-core back to 0.2.0. Works fine without rnwc and/or with frame processors disabled.

Any help would be much appreciated.

The example app doesn't appear to be working for other reasons.

Full build logs

info Opening app on Android...
info A dev server is already running for this project on port 8081.
info Installing the app...
> Task :gradle-plugin:compileKotlin UP-TO-DATE
> Task :gradle-plugin:compileJava NO-SOURCE
> Task :gradle-plugin:pluginDescriptors UP-TO-DATE
> Task :gradle-plugin:processResources UP-TO-DATE
> Task :gradle-plugin:classes UP-TO-DATE
> Task :gradle-plugin:jar UP-TO-DATE
> Task :gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE

> Configure project :openCVLib
OpenCV: 4.8.0 C:\Users\jslok\scan\android\openCVLib\build.gradle

> Configure project :react-native-vision-camera
[VisionCamera] react-native-worklets-core found, Frame Processors enabled!

> Task :app:generateCodegenSchemaFromJavaScript SKIPPED
> Task :app:generateCodegenArtifactsFromSchema SKIPPED
> Task :app:generatePackageList
> Task :app:preBuild
> Task :app:preDebugBuild
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :openCVLib:preBuild UP-TO-DATE
> Task :openCVLib:preDebugBuild UP-TO-DATE
> Task :openCVLib:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-vision-camera:prepareHeaders UP-TO-DATE
> Task :react-native-vision-camera:preBuild UP-TO-DATE
> Task :react-native-vision-camera:preDebugBuild UP-TO-DATE
> Task :react-native-vision-camera:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-worklets-core:prepareHeaders UP-TO-DATE
> Task :react-native-worklets-core:preBuild UP-TO-DATE
> Task :react-native-worklets-core:preDebugBuild UP-TO-DATE
> Task :react-native-worklets-core:writeDebugAarMetadata UP-TO-DATE
> Task :app:checkDebugAarMetadata UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :openCVLib:generateDebugResValues UP-TO-DATE
> Task :openCVLib:generateDebugResources UP-TO-DATE
> Task :openCVLib:packageDebugResources UP-TO-DATE
> Task :react-native-vision-camera:generateDebugResValues UP-TO-DATE
> Task :react-native-vision-camera:generateDebugResources UP-TO-DATE
> Task :react-native-vision-camera:packageDebugResources UP-TO-DATE
> Task :react-native-worklets-core:generateDebugResValues UP-TO-DATE
> Task :react-native-worklets-core:generateDebugResources UP-TO-DATE
> Task :react-native-worklets-core:packageDebugResources UP-TO-DATE
> Task :app:mapDebugSourceSetPaths UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:packageDebugResources UP-TO-DATE
> Task :app:parseDebugLocalResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :openCVLib:extractDeepLinksDebug UP-TO-DATE
> Task :openCVLib:processDebugManifest UP-TO-DATE
> Task :react-native-vision-camera:extractDeepLinksDebug UP-TO-DATE
> Task :react-native-vision-camera:processDebugManifest UP-TO-DATE
> Task :react-native-worklets-core:extractDeepLinksDebug UP-TO-DATE
> Task :react-native-worklets-core:processDebugManifest UP-TO-DATE
> Task :app:processDebugMainManifest UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugManifestForPackage UP-TO-DATE
> Task :openCVLib:compileDebugLibraryResources UP-TO-DATE
> Task :openCVLib:parseDebugLocalResources UP-TO-DATE
> Task :openCVLib:generateDebugRFile UP-TO-DATE
> Task :react-native-vision-camera:compileDebugLibraryResources UP-TO-DATE
> Task :react-native-vision-camera:parseDebugLocalResources UP-TO-DATE
> Task :react-native-vision-camera:generateDebugRFile UP-TO-DATE
> Task :react-native-worklets-core:compileDebugLibraryResources UP-TO-DATE
> Task :react-native-worklets-core:parseDebugLocalResources UP-TO-DATE
> Task :react-native-worklets-core:generateDebugRFile UP-TO-DATE
> Task :app:processDebugResources UP-TO-DATE
> Task :openCVLib:compileDebugAidl UP-TO-DATE
> Task :openCVLib:generateDebugBuildConfig UP-TO-DATE
> Task :openCVLib:compileDebugKotlin UP-TO-DATE
> Task :openCVLib:javaPreCompileDebug UP-TO-DATE
> Task :openCVLib:compileDebugJavaWithJavac UP-TO-DATE
> Task :openCVLib:bundleLibCompileToJarDebug UP-TO-DATE
> Task :react-native-vision-camera:generateDebugBuildConfig UP-TO-DATE
> Task :react-native-worklets-core:generateDebugBuildConfig UP-TO-DATE
> Task :react-native-worklets-core:javaPreCompileDebug UP-TO-DATE
> Task :react-native-worklets-core:compileDebugJavaWithJavac UP-TO-DATE
> Task :react-native-worklets-core:bundleLibCompileToJarDebug UP-TO-DATE
> Task :react-native-vision-camera:compileDebugKotlin UP-TO-DATE
> Task :react-native-vision-camera:javaPreCompileDebug UP-TO-DATE
> Task :react-native-vision-camera:compileDebugJavaWithJavac UP-TO-DATE
> Task :react-native-vision-camera:bundleLibCompileToJarDebug UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :openCVLib:mergeDebugShaders UP-TO-DATE
> Task :openCVLib:compileDebugShaders NO-SOURCE
> Task :openCVLib:generateDebugAssets UP-TO-DATE
> Task :openCVLib:packageDebugAssets UP-TO-DATE
> Task :react-native-vision-camera:mergeDebugShaders UP-TO-DATE
> Task :react-native-vision-camera:compileDebugShaders NO-SOURCE
> Task :react-native-vision-camera:generateDebugAssets UP-TO-DATE
> Task :react-native-vision-camera:packageDebugAssets UP-TO-DATE
> Task :react-native-worklets-core:mergeDebugShaders UP-TO-DATE
> Task :react-native-worklets-core:compileDebugShaders NO-SOURCE
> Task :react-native-worklets-core:generateDebugAssets UP-TO-DATE
> Task :react-native-worklets-core:packageDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:compressDebugAssets UP-TO-DATE
> Task :react-native-vision-camera:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :react-native-worklets-core:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :openCVLib:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :app:desugarDebugFileDependencies UP-TO-DATE
> Task :openCVLib:processDebugJavaRes UP-TO-DATE
> Task :react-native-vision-camera:processDebugJavaRes UP-TO-DATE
> Task :react-native-worklets-core:processDebugJavaRes NO-SOURCE
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
> Task :app:mergeExtDexDebug UP-TO-DATE
> Task :app:mergeLibDexDebug UP-TO-DATE
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :openCVLib:configureCMakeDebug[arm64-v8a]
> Task :openCVLib:buildCMakeDebug[arm64-v8a][opencv_jni_shared]
> Task :openCVLib:configureCMakeDebug[armeabi-v7a]
> Task :openCVLib:buildCMakeDebug[armeabi-v7a][opencv_jni_shared]
> Task :openCVLib:configureCMakeDebug[x86]
> Task :openCVLib:buildCMakeDebug[x86][opencv_jni_shared]
> Task :openCVLib:configureCMakeDebug[x86_64]
> Task :openCVLib:buildCMakeDebug[x86_64][opencv_jni_shared]
> Task :openCVLib:mergeDebugJniLibFolders UP-TO-DATE
> Task :openCVLib:mergeDebugNativeLibs UP-TO-DATE
> Task :openCVLib:copyDebugJniLibsProjectOnly UP-TO-DATE
> Task :react-native-worklets-core:configureCMakeDebug[arm64-v8a]
> Task :react-native-worklets-core:configureCMakeDebug[armeabi-v7a]
> Task :react-native-worklets-core:configureCMakeDebug[x86]
> Task :react-native-worklets-core:configureCMakeDebug[x86_64]
> Task :react-native-worklets-core:generateJsonModelDebug
> Task :react-native-worklets-core:prefabDebugConfigurePackage UP-TO-DATE
> Task :react-native-vision-camera:configureCMakeDebug[arm64-v8a]
> Task :app:compileDebugKotlin
> Task :react-native-worklets-core:buildCMakeDebug[arm64-v8a]
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:dexBuilderDebug
> Task :app:mergeDebugGlobalSynthetics UP-TO-DATE
> Task :app:processDebugJavaRes UP-TO-DATE
> Task :app:mergeDebugJavaResource UP-TO-DATE
> Task :app:mergeProjectDexDebug
> Task :react-native-worklets-core:buildCMakeDebug[armeabi-v7a]
> Task :react-native-worklets-core:buildCMakeDebug[x86]
> Task :react-native-worklets-core:buildCMakeDebug[x86_64]
> Task :react-native-worklets-core:externalNativeBuildDebug
> Task :react-native-worklets-core:prefabDebugPackage UP-TO-DATE

> Task :react-native-vision-camera:buildCMakeDebug[arm64-v8a] FAILED
C/C++: ninja: Entering directory `C:\Users\jslok\scan\node_modules\react-native-vision-camera\android\.cxx\Debug\2g1s6i66\arm64-v8a'
C/C++: cmd.exe /C "cd . && C:\Users\jslok\AppData\Local\Android\Sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --sysroot=C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all -fno-limit-debug-info  -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--gc-sections -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libVisionCamera.so -o ..\..\..\..\build\intermediates\cxx\Debug\2g1s6i66\obj\arm64-v8a\libVisionCamera.so CMakeFiles/VisionCamera.dir/C_/Users/jslok/scan/node_modules/react-native-vision-camera/cpp/JSITypedArray.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/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/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/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/21/liblog.so  -landroid  C:/Users/jslok/.gradle/caches/transforms-3/0859cc2ebf96bc372b2c46ef5b293d59/transformed/jetified-react-android-0.73.0-debug/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so  C:/Users/jslok/.gradle/caches/transforms-3/0859cc2ebf96bc372b2c46ef5b293d59/transformed/jetified-react-android-0.73.0-debug/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so  C:/Users/jslok/.gradle/caches/transforms-3/057fda56c2cfc52d70a46042a30c6944/transformed/jetified-fbjni-0.5.1/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so  -lGLESv2  -lEGL  -latomic -lm && cd ."
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::getWorkletRuntime()
C/C++: >>> referenced by JFrameProcessor.cpp:37 (C:/Users/jslok/scan/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp:37)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(vision::JFrameProcessor::callWithFrameHostObject(std::__ndk1::shared_ptr<vision::FrameHostObject> const&) const)
C/C++: >>> referenced by JVisionCameraProxy.cpp:57 (C:/Users/jslok/scan/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp:57)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vision::JVisionCameraProxy::~JVisionCameraProxy())
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnJsThread(std::__ndk1::function<void (facebook::jsi::Runtime&)>&&)
C/C++: >>> referenced by JFrameProcessor.cpp:50 (C:/Users/jslok/scan/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp:50)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(vision::JFrameProcessor::callWithFrameHostObject(std::__ndk1::shared_ptr<vision::FrameHostObject> const&) const)
C/C++: >>> referenced by WKTJsiWorklet.h:358 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorklet.h:358)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::~WorkletInvoker())
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::runtimeMappings
C/C++: >>> referenced by __tree:0 (C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__tree:0)
C/C++: >>>               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))
C/C++: >>> referenced by __tree:0 (C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__tree:0)
C/C++: >>>               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))
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnWorkletThread(std::__ndk1::function<void (RNWorklet::JsiWorkletContext*, facebook::jsi::Runtime&)>&&)
C/C++: >>> referenced by WKTJsiWorklet.h:361 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorklet.h:361)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::~WorkletInvoker())
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::defaultInstance
C/C++: >>> referenced by memory:3887 (C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/memory:3887)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: >>> referenced by memory:3887 (C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/memory:3887)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::JsiHostObject()
C/C++: >>> referenced by WKTJsiWorkletContext.h:31 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorkletContext.h:31)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: >>> referenced by WKTJsiWorklet.h:77 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorklet.h:77)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&))
C/C++: ld: error: undefined symbol: vtable for RNWorklet::JsiWorkletContext
C/C++: >>> referenced by WKTJsiWorkletContext.h:31 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorkletContext.h:31)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: >>> referenced by WKTJsiWorkletContext.h:31 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorkletContext.h:31)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::~JsiWorkletContext()
C/C++: >>> referenced by memory:2252 (C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/memory:2252)
C/C++: >>>               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())
C/C++: >>> referenced by memory:2252 (C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/memory:2252)
C/C++: >>>               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())
C/C++: 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 ()>&&)>)
C/C++: >>> referenced by memory:2278 (C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/memory:2278)
C/C++: >>>               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&))
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::~JsiHostObject()
C/C++: >>> referenced by WKTJsiWorklet.h:79 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorklet.h:79)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&))
C/C++: >>> referenced by WKTJsiWorklet.h:74 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorklet.h:74)
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::~JsiWorklet())
C/C++: ld: error: undefined symbol: RNWorklet::JsiWrapper::wrap(facebook::jsi::Runtime&, facebook::jsi::Value const&, RNWorklet::JsiWrapper*)
C/C++: >>> referenced by WKTJsiWrapper.h:62 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWrapper.h:62)
C/C++: >>>               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>))
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)
C/C++: >>> referenced by JVisionCameraProxy.cpp
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet)
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)
C/C++: >>> referenced by JVisionCameraProxy.cpp
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet)
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::getPropertyNames(facebook::jsi::Runtime&)
C/C++: >>> referenced by JVisionCameraProxy.cpp
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet)
C/C++: ld: error: undefined symbol: typeinfo for RNWorklet::JsiHostObject
C/C++: >>> referenced by JVisionCameraProxy.cpp
C/C++: >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(typeinfo for RNWorklet::JsiWorklet)
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
C/C++: ninja: build stopped: subcommand failed.
111 actionable tasks: 23 executed, 88 up-to-date

info šŸ’” Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

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:\Users\jslok\scan\node_modules\react-native-vision-camera\android\.cxx\Debug\2g1s6i66\arm64-v8a'
  [1/1] Linking CXX shared library ..\..\..\..\build\intermediates\cxx\Debug\2g1s6i66\obj\arm64-v8a\libVisionCamera.so
  FAILED: ../../../../build/intermediates/cxx/Debug/2g1s6i66/obj/arm64-v8a/libVisionCamera.so
  cmd.exe /C "cd . && C:\Users\jslok\AppData\Local\Android\Sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --sysroot=C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all -fno-limit-debug-info  -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--gc-sections -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libVisionCamera.so -o ..\..\..\..\build\intermediates\cxx\Debug\2g1s6i66\obj\arm64-v8a\libVisionCamera.so CMakeFiles/VisionCamera.dir/C_/Users/jslok/scan/node_modules/react-native-vision-camera/cpp/JSITypedArray.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/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/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/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/21/liblog.so  -landroid  C:/Users/jslok/.gradle/caches/transforms-3/0859cc2ebf96bc372b2c46ef5b293d59/transformed/jetified-react-android-0.73.0-debug/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so  C:/Users/jslok/.gradle/caches/transforms-3/0859cc2ebf96bc372b2c46ef5b293d59/transformed/jetified-react-android-0.73.0-debug/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so  C:/Users/jslok/.gradle/caches/transforms-3/057fda56c2cfc52d70a46042a30c6944/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 JFrameProcessor.cpp:37 (C:/Users/jslok/scan/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)
  >>> referenced by JVisionCameraProxy.cpp:57 (C:/Users/jslok/scan/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp:57)
  >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vision::JVisionCameraProxy::~JVisionCameraProxy())

  ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnJsThread(std::__ndk1::function<void (facebook::jsi::Runtime&)>&&)
  >>> referenced by JFrameProcessor.cpp:50 (C:/Users/jslok/scan/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp:50)
  >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(vision::JFrameProcessor::callWithFrameHostObject(std::__ndk1::shared_ptr<vision::FrameHostObject> const&) const)
  >>> referenced by WKTJsiWorklet.h:358 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorklet.h:358)
  >>>               CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::~WorkletInvoker())

  ld: error: undefined symbol: RNWorklet::JsiWorkletContext::runtimeMappings
  >>> referenced by __tree:0 (C:/Users/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/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/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/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:361 (C:/Users/jslok/scan/node_modules/react-native-worklets-core/android/build/headers/rnworklets/react-native-worklets-core/WKTJsiWorklet.h:361)
  >>>               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/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/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/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/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:/Users/jslok/scan/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:/Users/jslok/scan/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:/Users/jslok/scan/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:/Users/jslok/scan/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/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/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/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/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/jslok/AppData/Local/Android/Sdk/ndk/25.1.8937393/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:/Users/jslok/scan/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:/Users/jslok/scan/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:/Users/jslok/scan/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\\jslok\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
        -C ^
        "C:\\Users\\jslok\\scan\\node_modules\\react-native-vision-camera\\android\\.cxx\\Debug\\2g1s6i66\\arm64-v8a" ^
        VisionCamera
    from C:\Users\jslok\scan\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 7s

Project dependencies

"dependencies": {
    "react": "18.2.0",
    "react-native": "^0.73.0",
    "react-native-vision-camera": "^3.6.16",
    "react-native-worklets-core": "0.2.1"
  },

VisionCamera Version

3.6.16

Target platforms

Android

Operating system

Windows

Can you build the VisionCamera Example app?

No, I cannot build the Example app either

Additional information

rodgomesc commented 11 months ago

this also happens to me quite often, it builds after deleting android/.gradle folder

c-info commented 11 months ago

having same issue when running the command cd android && ./gradlew clean && cd - && npx react-native run-android

gyanbhartip commented 10 months ago

deleting android/.gradle folder before building helped fix this for me.

gzqyl commented 10 months ago

deleting android/.gradle folder before building helped fix this for me.

this should be the correct answer, just test it, when build error occurs, clean project does not work, we need to delete the whole cache folder

dipudk29 commented 10 months ago

deleting android/.gradle folder before building helped fix this for me.

Life savior.

divitrao commented 10 months ago

getting this error here

C/C++: CMake Generate step failed. Build files cannot be regenerated correctly. [CXX1429] error when building with cmake using C:\Users\divit\Nutrify\nutodaymobileapp\node_modules\react-native-vision-camera\android\CMakeLists.txt: -- Android: Targeting API '26' with architecture 'x86', ABI 'x86', and processor 'i686' -- Android: Selected unified Clang toolchain -- The C compiler identification is Clang 12.0.8 -- The CXX compiler identification is Clang 12.0.8 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Users/divit/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Users/divit/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done

C++ build system [configure] failed while executing: @echo off "C:\Users\divit\AppData\Local\Android\Sdk\cmake\3.22.1\bin\cmake.exe" ^ "-HC:\Users\divit\Nutrify\nutodaymobileapp\node_modules\react-native-vision-camera\android" ^ "-DCMAKE_SYSTEM_NAME=Android" ^ "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^ "-DCMAKE_SYSTEM_VERSION=26" ^ "-DANDROID_PLATFORM=android-26" ^ "-DANDROID_ABI=x86" ^ "-DCMAKE_ANDROID_ARCH_ABI=x86" ^ "-DANDROID_NDK=C:\Users\divit\AppData\Local\Android\Sdk\ndk\23.1.7779620" ^ "-DCMAKE_ANDROID_NDK=C:\Users\divit\AppData\Local\Android\Sdk\ndk\23.1.7779620" ^ "-DCMAKE_TOOLCHAIN_FILE=C:\Users\divit\AppData\Local\Android\Sdk\ndk\23.1.7779620\build\cmake\android.toolchain.cmake" ^ "-DCMAKE_MAKE_PROGRAM=C:\Users\divit\AppData\Local\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^ "-DCMAKE_CXX_FLAGS=-O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all" ^ "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\divit\Nutrify\nutodaymobileapp\node_modules\react-native-vision-camera\android\build\intermediates\cxx\Debug\142u2c03\obj\x86" ^ "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:\Users\divit\Nutrify\nutodaymobileapp\node_modules\react-native-vision-camera\android\build\intermediates\cxx\Debug\142u2c03\obj\x86" ^ "-DCMAKE_BUILD_TYPE=Debug" ^ "-DCMAKE_FIND_ROOT_PATH=C:\Users\divit\Nutrify\nutodaymobileapp\node_modules\react-native-vision-camera\android\.cxx\Debug\142u2c03\prefab\x86\prefab" ^ "-BC:\Users\divit\Nutrify\nutodaymobileapp\node_modules\react-native-vision-camera\android\.cxx\Debug\142u2c03\x86" ^ -GNinja ^ "-DANDROID_STL=c++_shared" ^ "-DNODE_MODULES_DIR=C:\Users\divit\Nutrify\nutodaymobileapp\node_modules" ^ "-DENABLE_FRAME_PROCESSORS=true" from C:\Users\divit\Nutrify\nutodaymobileapp\node_modules\react-native-vision-camera\android VisionCamera: Frame Processors enabled! CMake Error in CMakeLists.txt: Imported target "react-native-worklets-core::rnworklets" includes non-existent path

"C:/Users/divit/Nutrify/nutodaymobileapp/node_modules/react-native-worklets-core/android/build/headers/rnworklets"

in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:

CMake Generate step failed. Build files cannot be regenerated correctly.

i have "react-native-worklets-core": "^0.2.4", and "react-native-vision-camera": "3.6.4",

it is searching for a file which does not even exists node_modules/react-native-worklets-core/android/build/headers/rnworklets

mrousavy commented 10 months ago

Clean your cache and try again. For me it works in a new project.

Heni-ghodbane commented 8 months ago

We are still facing this error while building using Android Studio. Any suggestions? thanks These are the versions

"react-native-vision-camera": "^3.6.12",
"react-native-worklets-core": "^0.3.0",

rares-lupascu commented 8 months ago

same here

wuguishifu commented 7 months ago

I'm still getting this issue after the following attempts to fix it: 1) deleting the android/.gradle folder 2) clearing all cache in android studio and restarting 3) working in a fresh isolated (linux) container 4) working on a fresh computer (mac os)

Edit: Quite literally immediately after posting this I tried deleting the .gradle folder again and it did work. Maybe it's luck based. It also may be that there were background tasks still going on to decache some files and waiting a bit for me to type this message allowed it to finish up.

tomerh2001 commented 5 months ago

Also facing it now

    "react-native-vision-camera": "4.0.5",
    "react-native-worklets-core": "^1.3.3",
    "vision-camera-resize-plugin": "^3.1.0",
    "@ismaelmoreiraa/vision-camera-ocr": "^3.0.1",

This is the error:

> Task :prepareKotlinBuildScriptModel UP-TO-DATE
C/C++: VisionCamera: Frame Processors: ON!
C/C++: VisionCamera: Linking react-native-worklets...
C/C++: CMake Error in CMakeLists.txt:
C/C++:   Imported target "react-native-worklets-core::rnworklets" includes
C/C++:   non-existent path
C/C++:     "C:/projects/RC/x-workspace/projects/xmobile/node_modules/react-native-worklets-core/android/build/headers/rnworklets"
C/C++:   in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
C/C++:   * The path was deleted, renamed, or moved to another location.
C/C++:   * An install or uninstall procedure did not complete successfully.
C/C++:   * The installation package was faulty and references files it does not
C/C++:   provide.
C/C++: CMake Generate step failed.  Build files cannot be regenerated correctly.
hungtrn75 commented 4 months ago

Also facing it now

    "react-native-vision-camera": "4.0.5",
    "react-native-worklets-core": "^1.3.3",
    "vision-camera-resize-plugin": "^3.1.0",
    "@ismaelmoreiraa/vision-camera-ocr": "^3.0.1",

This is the error:

> Task :prepareKotlinBuildScriptModel UP-TO-DATE
C/C++: VisionCamera: Frame Processors: ON!
C/C++: VisionCamera: Linking react-native-worklets...
C/C++: CMake Error in CMakeLists.txt:
C/C++:   Imported target "react-native-worklets-core::rnworklets" includes
C/C++:   non-existent path
C/C++:     "C:/projects/RC/x-workspace/projects/xmobile/node_modules/react-native-worklets-core/android/build/headers/rnworklets"
C/C++:   in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
C/C++:   * The path was deleted, renamed, or moved to another location.
C/C++:   * An install or uninstall procedure did not complete successfully.
C/C++:   * The installation package was faulty and references files it does not
C/C++:   provide.
C/C++: CMake Generate step failed.  Build files cannot be regenerated correctly.

Same issue

bonnmh commented 4 months ago

Also facing it now

    "react-native-vision-camera": "4.0.5",
    "react-native-worklets-core": "^1.3.3",
    "vision-camera-resize-plugin": "^3.1.0",
    "@ismaelmoreiraa/vision-camera-ocr": "^3.0.1",

This is the error:

> Task :prepareKotlinBuildScriptModel UP-TO-DATE
C/C++: VisionCamera: Frame Processors: ON!
C/C++: VisionCamera: Linking react-native-worklets...
C/C++: CMake Error in CMakeLists.txt:
C/C++:   Imported target "react-native-worklets-core::rnworklets" includes
C/C++:   non-existent path
C/C++:     "C:/projects/RC/x-workspace/projects/xmobile/node_modules/react-native-worklets-core/android/build/headers/rnworklets"
C/C++:   in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
C/C++:   * The path was deleted, renamed, or moved to another location.
C/C++:   * An install or uninstall procedure did not complete successfully.
C/C++:   * The installation package was faulty and references files it does not
C/C++:   provide.
C/C++: CMake Generate step failed.  Build files cannot be regenerated correctly.

I encountered the same error, have you resolved the above error?

PrinceUBS commented 3 months ago

I'm facing this issue! how you guys able to fix?

nppull commented 2 months ago

Android Studio Koala | 2024.1.1 Patch 2 macOS 14.4 react native 0.74.5 react-native-vision-camera: 4.3.2 react-native-worklets-core: 1.3.3

same error

thaindangelhack commented 2 months ago
react-native: 0.74.5
react-native-reanimated: 3.10.1
react-native-vision-camera: 3.9.2
react-native-worklets-core: 1.3.3

I got the same error I tried deleting the file many times like most suggested, but it didn't work for me I also tried upgrading the libraries (react-native-reanimated, react-native-vision-camera, react-native-worklets-core) to different versions (including the latest) but still got the same error

I am waiting for a more accurate solution, can anyone help me?

nppull commented 2 weeks ago
react-native: 0.74.5
react-native-reanimated: 3.10.1
react-native-vision-camera: 3.9.2
react-native-worklets-core: 1.3.3

I got the same error I tried deleting the file many times like most suggested, but it didn't work for me I also tried upgrading the libraries (react-native-reanimated, react-native-vision-camera, react-native-worklets-core) to different versions (including the latest) but still got the same error

I am waiting for a more accurate solution, can anyone help me?

react-native-vision-camera: 3.9.2 work with react-native-worklets-core: 0.3.0

thaindangelhack commented 2 weeks ago
react-native: 0.74.5
react-native-reanimated: 3.10.1
react-native-vision-camera: 3.9.2
react-native-worklets-core: 1.3.3

I got the same error I tried deleting the file many times like most suggested, but it didn't work for me I also tried upgrading the libraries (react-native-reanimated, react-native-vision-camera, react-native-worklets-core) to different versions (including the latest) but still got the same error I am waiting for a more accurate solution, can anyone help me?

react-native-vision-camera: 3.9.2 work with react-native-worklets-core: 0.3.0

thanks, maybe i will try later

i noticed that react-native-worklets-core was recently added (from react upgrade recommendation), the previous build didn't have it.

i'm not sure what the purpose of adding this lib is, but i removed it, everything still works

afiq234 commented 2 weeks ago

{ "name": "TestDetection", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest" }, "dependencies": { "react": "18.2.0", "react-native": "0.74.5", "react-native-reanimated": "^3.15.4", "react-native-vision-camera": "^4.5.2", "react-native-worklets-core": "^1.3.3" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "0.74.87", "@react-native/eslint-config": "0.74.87", "@react-native/metro-config": "0.74.87", "@react-native/typescript-config": "0.74.87", "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.2.0", "typescript": "5.0.4" }, "engines": { "node": ">=18" } }

this one works for me