rodgomesc / vision-camera-face-detector

VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector
MIT License
96 stars 66 forks source link

project not run in android after installed this npm #49

Open vijaykhandal1290 opened 11 months ago

vijaykhandal1290 commented 11 months ago

I am installing latest version of npm. After then my project not run .

Error : 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 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. 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 `D:\Projects\Learning\VideoSelf\nodemodules\react-native-vision-camera\android.cxx\Debug\1g4k641t\arm64-v8a' [1/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLRenderer.cpp.o [2/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/PassThroughShader.cpp.o [3/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLContext.cpp.o [4/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessorPlugin.cpp.o [5/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrame.cpp.o [6/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameProcessorPluginHostObject.cpp.o [7/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o [8/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameHostObject.cpp.o [9/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VideoPipeline.cpp.o [10/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp.o [11/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/JSIJNIConversion.cpp.o [12/16] Building CXX object CMakeFiles/VisionCamera.dir/D/Projects/Learning/VideoSelf/node_modules/react-native-vision-camera/cpp/JSITypedArray.cpp.o [13/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/VisionCameraProxy.cpp.o [14/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o [15/16] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o [16/16] Linking CXX shared library ........\build\intermediates\cxx\Debug\1g4k641t\obj\arm64-v8a\libVisionCamera.so FAILED: ../../../../build/intermediates/cxx/Debug/1g4k641t/obj/arm64-v8a/libVisionCamera.so cmd.exe /C "cd . && E:\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android23 --sysroot=E:/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x8664/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\1g4k641t\obj\arm64-v8a\libVisionCamera.so CMakeFiles/VisionCamera.dir/D/Projects/Learning/VideoSelf/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 E:/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/23/liblog.so -landroid C:/Users/Vijay/.gradle/caches/transforms-3/0859cc2ebf96bc372b2c46ef5b293d59/transformed/jetified-react-android-0.73.0-debug/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so C:/Users/Vijay/.gradle/caches/transforms-3/0859cc2ebf96bc372b2c46ef5b293d59/transformed/jetified-react-android-0.73.0-debug/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so C:/Users/Vijay/.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 (D:/Projects/Learning/VideoSelf/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 const&) const) >>> referenced by JVisionCameraProxy.cpp:57 (D:/Projects/Learning/VideoSelf/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 (D:/Projects/Learning/VideoSelf/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 const&) const) >>> referenced by WKTJsiWorklet.h:369 (D:/Projects/Learning/VideoSelf/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::runtimeMappings >>> referenced by tree:0 (E:/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 (E:/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 (D:/Projects/Learning/VideoSelf/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::defaultInstance >>> referenced by memory:3887 (E:/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 (E:/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 (D:/Projects/Learning/VideoSelf/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 (D:/Projects/Learning/VideoSelf/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 (D:/Projects/Learning/VideoSelf/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 (D:/Projects/Learning/VideoSelf/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 (E:/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 >::~shared_ptr_emplace()) >>> referenced by memory:2252 (E:/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 >::~shared_ptr_emplace()) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::JsiWorkletContext(std::ndk1::basic_string<char, std::__ndk1::char_traits, std::ndk1::allocator > const&, facebook::jsi::Runtime*, std::ndk1::function<void (std::ndk1::function<void ()>&&)>, std::ndk1::function<void (std::__ndk1::function<void ()>&&)>)

referenced by memory:2278 (E:/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 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 (D:/Projects/Learning/VideoSelf/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 (D:/Projects/Learning/VideoSelf/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 (D:/Projects/Learning/VideoSelf/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)) 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 "E:\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^ -C ^ "D:\Projects\Learning\VideoSelf\node_modules\react-native-vision-camera\android\.cxx\Debug\1g4k641t\arm64-v8a" ^ VisionCamera from D:\Projects\Learning\VideoSelf\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 2m 26s. info Run CLI with --verbose flag for more details.

my npms: "react": "18.2.0", "react-native": "0.73.0", "react-native-vision-camera": "3.6.16", "react-native-worklets-core": "^0.2.4"

AzranAzwer commented 10 months ago

anu solutions ?

ErickFraga commented 9 months ago

same here

Raamzeez commented 9 months ago

Same problem here. Please let us know if someone finds an alternative to this plugin that is modern and works for face detection because this is over 2 years old and there have been no changes.

levepic commented 9 months ago

Yes I have found: https://github.com/trustee-wallet/vision-camera-trustee-face-detector-v3 Although you need to temporarily downgrade vision-camera to 3.7.1 until the face detector is upgraded for the newest version (with breaking changes) - which should be in progress according to the author. For worklets (at least for the newest) you need RN 0.71 or higher.

AzranAzwer commented 8 months ago

Hi @levepic Did it work for you ? when i try on Android, Build failed

levepic commented 8 months ago

Hi @levepic Did it work for you ? when i try on Android, Build failed

Yes it does build successfully and works, but I had to downgrade vision-camera to 3.7.1. Also for worklets (at least for the newest) you need RN 0.71 or higher. And im not using THIS face detector plugin, but https://github.com/trustee-wallet/vision-camera-trustee-face-detector-v3. Still I have a memory leak issue (posted at worklets issues), there is a leak when calling JS function from the worklet (with detected faces).

nolife08021 commented 5 months ago

@levepic hi i using vision-camera v3.7.1, worklets v1.3.3 and vision-camera-truestee-face-detector-v3 v1.5.0-beta-0.11. but facing below issue, do you have any solution for this issue?

/node_modules/vision-camera-trustee-face-detector-v3/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:12: error: package com.mrousavy.camera.frameprocessors does not exist
import com.mrousavy.camera.frameprocessors.Frame;