Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Task :react-native-vision-camera:externalNativeBuildDebug failed on android build after upgrade to React-Native 0.66 #614

Closed
3 of 4 tasks
stephraja opened this issue Nov 26, 2021 · 12 comments
Labels
馃悰 bug Something isn't working

Comments

@stephraja
Copy link

What were you trying to do?

After upgrading my application from React-Native 0.65 to 0.66, the build android is failing on executing react-native-vision-camera actions

I've looked for a similar issue into this repo but there is no one that looks like it instead of #609 which is already fixed and applied with the 2.9.4 version that I'm using

I am not familiar with Android build and debug that is why I am posting this issue if some people knows how to resolve or understand it and can explain me

I have tried to downgrade the ndk-version from 21.4.7075529 to 20.1.5948944 to see if the problems comes from this but it did not solve the problem

The iOS build works with no problem btw

Reproduceable Code

No response

What happened instead?

The android installation to my device crashes with the following error :

Relevant log output

Execution failed for task ':react-native-vision-camera:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process /Users/up2it/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C <project-path>/node_modules/react-native-vision-camera/android/.cxx/cmake/debug/armeabi-v7a VisionCamera}
  ninja: Entering directory `<project-path>/node_modules/react-native-vision-camera/android/.cxx/cmake/debug/armeabi-v7a'
  [1/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JHashMap.cpp.o
  [2/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JImageProxy.cpp.o
  [3/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JFrameProcessorPlugin.cpp.o
  [4/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/CameraView.cpp.o
  [5/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCameraScheduler.cpp.o
  [6/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o
  [7/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o
  [8/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o
  [9/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o
  [10/10] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libVisionCamera.so
  FAILED: ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libVisionCamera.so 
  : && /Users/up2it/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi21 --gcc-toolchain=/Users/up2it/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/up2it/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DON_ANDROID -DONANDROID -DFOR_HERMES=true -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,--fatal-warnings -Wl,--exclude-libs,libunwind.a -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libVisionCamera.so -o ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libVisionCamera.so CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/CameraView.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCameraScheduler.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JFrameProcessorPlugin.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JImageProxy.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JHashMap.cpp.o -L<project-path>/node_modules/react-native-vision-camera/android/build/third-party-ndk/hermes/jni/armeabi-v7a  -L<project-path>/node_modules/react-native-vision-camera/android/build/react-native-reanimated-66-hermes.aar/jni/armeabi-v7a  -L<project-path>/node_modules/react-native-vision-camera/android/build/react-native-0.66.3.aar/jni/armeabi-v7a -llog -lhermes -lreanimated -lreactnativejni -lfbjni -lfolly_json -landroid -latomic -lm && :
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function vision::JSIJNIConversion::convertJSIValueToJNIObject(facebook::jsi::Runtime&, facebook::jsi::Value const&): error: undefined reference to 'facebook::jsi::Value::asObject(facebook::jsi::Runtime&) const &'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function vision::JSIJNIConversion::convertJSIValueToJNIObject(facebook::jsi::Runtime&, facebook::jsi::Value const&): error: undefined reference to 'facebook::jsi::dynamicFromValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function vision::JSIJNIConversion::convertJSIValueToJNIObject(facebook::jsi::Runtime&, facebook::jsi::Value const&): error: undefined reference to 'facebook::jsi::dynamicFromValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function vision::JSIJNIConversion::convertJSIValueToJNIObject(facebook::jsi::Runtime&, facebook::jsi::Value const&): error: undefined reference to 'facebook::jsi::Value::toString(facebook::jsi::Runtime&) const'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function vision::JSIJNIConversion::convertJSIValueToJNIObject(facebook::jsi::Runtime&, facebook::jsi::Value const&): error: undefined reference to 'typeinfo for facebook::jsi::HostObject'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function vision::JSIJNIConversion::convertJNIObjectToJSIValue(facebook::jsi::Runtime&, facebook::jni::basic_strong_ref<_jobject*, facebook::jni::LocalReferenceAllocator> const&): error: undefined reference to 'facebook::jsi::Value::~Value()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function vision::JSIJNIConversion::convertJNIObjectToJSIValue(facebook::jsi::Runtime&, facebook::jni::basic_strong_ref<_jobject*, facebook::jni::LocalReferenceAllocator> const&): error: undefined reference to 'facebook::jsi::Value::~Value()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function vision::JSIJNIConversion::convertJNIObjectToJSIValue(facebook::jsi::Runtime&, facebook::jni::basic_strong_ref<_jobject*, facebook::jni::LocalReferenceAllocator> const&): error: undefined reference to 'facebook::jsi::Value::~Value()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function vision::JSIJNIConversion::convertJNIObjectToJSIValue(facebook::jsi::Runtime&, facebook::jni::basic_strong_ref<_jobject*, facebook::jni::LocalReferenceAllocator> const&): error: undefined reference to 'facebook::jsi::Value::~Value()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function facebook::jsi::Value::Value<facebook::jsi::String>(facebook::jsi::String&&): error: undefined reference to 'facebook::jsi::Value::~Value()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function facebook::jsi::Value::Value<facebook::jsi::Array>(facebook::jsi::Array&&): error: undefined reference to 'facebook::jsi::Value::~Value()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function facebook::jsi::Value::Value<facebook::jsi::Object>(facebook::jsi::Object&&): error: undefined reference to 'facebook::jsi::Value::~Value()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o:JSIJNIConversion.cpp:function facebook::jsi::detail::toValue(facebook::jsi::Runtime&, facebook::jsi::Value const&): error: undefined reference to 'facebook::jsi::Value::Value(facebook::jsi::Runtime&, facebook::jsi::Value const&)'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function vision::FrameHostObject::FrameHostObject(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JImageProxy, facebook::jni::JObject, void>::_javaobject*>): error: undefined reference to 'facebook::jsi::HostObject::~HostObject()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function vision::FrameHostObject::~FrameHostObject(): error: undefined reference to 'facebook::jsi::HostObject::~HostObject()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function vision::FrameHostObject::~FrameHostObject(): error: undefined reference to 'facebook::jsi::HostObject::~HostObject()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function vision::FrameHostObject::assertIsFrameStrong(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const: error: undefined reference to 'typeinfo for facebook::jsi::JSError'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function vision::FrameHostObject::assertIsFrameStrong(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const: error: undefined reference to 'facebook::jsi::JSError::~JSError()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function vision::FrameHostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_2::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int) const: error: undefined reference to 'typeinfo for facebook::jsi::JSError'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function vision::FrameHostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_2::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int) const: error: undefined reference to 'facebook::jsi::JSError::~JSError()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function facebook::jsi::HostObject::HostObject(): error: undefined reference to 'vtable for facebook::jsi::HostObject'
  /Users/up2it/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function facebook::jsi::Value::Value<facebook::jsi::Function>(facebook::jsi::Function&&): error: undefined reference to 'facebook::jsi::Value::~Value()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:function facebook::jsi::JSError::JSError(facebook::jsi::Runtime&, char const*): error: undefined reference to 'facebook::jsi::JSError::JSError(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:vtable for vision::FrameHostObject: error: undefined reference to 'facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o:FrameHostObject.cpp:typeinfo for vision::FrameHostObject: error: undefined reference to 'typeinfo for facebook::jsi::HostObject'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::setFrameProcessor(facebook::jsi::Runtime&, int, facebook::jsi::Value const&): error: undefined reference to 'typeinfo for facebook::jsi::JSError'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::setFrameProcessor(facebook::jsi::Runtime&, int, facebook::jsi::Value const&): error: undefined reference to 'facebook::jsi::JSError::~JSError()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::logErrorToJS(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)::$_0::operator()() const: error: undefined reference to 'facebook::jsi::Object::getPropertyAsObject(facebook::jsi::Runtime&, char const*) const'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::logErrorToJS(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)::$_0::operator()() const: error: undefined reference to 'facebook::jsi::Object::getPropertyAsFunction(facebook::jsi::Runtime&, char const*) const'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::setFrameProcessor(facebook::jsi::Runtime&, int, facebook::jsi::Value const&)::$_1::operator()() const: error: undefined reference to 'facebook::jsi::Value::asObject(facebook::jsi::Runtime&) &&'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::setFrameProcessor(facebook::jsi::Runtime&, int, facebook::jsi::Value const&)::$_1::operator()() const: error: undefined reference to 'facebook::jsi::Object::asFunction(facebook::jsi::Runtime&) &&'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::installJSIBindings()::$_2::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int) const: error: undefined reference to 'facebook::jsi::Value::asNumber() const'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::installJSIBindings()::$_2::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int) const: error: undefined reference to 'typeinfo for facebook::jsi::JSError'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::installJSIBindings()::$_2::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int) const: error: undefined reference to 'facebook::jsi::JSError::~JSError()'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::installJSIBindings()::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int) const: error: undefined reference to 'facebook::jsi::Value::asNumber() const'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function vision::FrameProcessorRuntimeManager::registerPlugin(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrameProcessorPlugin, facebook::jni::JObject, void>::_javaobject*>)::$_4::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int) const: error: undefined reference to 'facebook::jsi::Value::asObject(facebook::jsi::Runtime&) const &'
  CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o:FrameProcessorRuntimeManager.cpp:function std::__ndk1::shared_ptr<facebook::jsi::HostObject> facebook::jsi::Object::asHostObject<facebook::jsi::HostObject>(facebook::jsi::Runtime&) const: error: undefined reference to 'facebook::jsi::detail::throwJSError(facebook::jsi::Runtime&, char const*)'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.

Device

Huawei P20 Lite

VisionCamera Version

2.9.4

Additional information

@stephraja stephraja added the 馃悰 bug Something isn't working label Nov 26, 2021
@jettandres

This comment has been minimized.

@NiketanG
Copy link

NiketanG commented Nov 27, 2021

+1 Same issue here, Downgrading to React Native 0.65.0 fixes the issue

@stephraja
Copy link
Author

I have tried to upgrade my CMake version from 3.10.2.4988404 to 3.18.1 but still have the same output.

I will continue to work on it and let you know if I find a solution

@Shreyakkk

This comment has been minimized.

@FloweryK
Copy link

FloweryK commented Dec 3, 2021

same here. I also tested with version 2.9.0, and still cannot build with either RN 0.65 and 0.66 ;(

@jackstudd

This comment has been minimized.

@batical
Copy link

batical commented Dec 10, 2021

still present in 2.10.0

@stephraja
Copy link
Author

stephraja commented Dec 15, 2021

I found the solution, I was facing the #588 issue before I upgraded React Native and I patched the CMAKELIST.txt file by removing the JSI_LIB like mentioned in #513

I have totally forgotten that I patched this file package, that is why I did not found this solution directly

After I removed this patch, the Android application build completely without a problem

Hope that it will help everyone who face this issue

@abdullahIsa
Copy link

abdullahIsa commented Jan 2, 2022

For anyone having this issue, do the same as this #588 (comment)

@sami-99
Copy link

sami-99 commented Feb 15, 2022

I have the same issue using react-native-vision-camera: 2.12.0 and react-native: 0.67.2.
I tried the above solutions but none worked for me

@geakk
Copy link

geakk commented Feb 17, 2022

same as @sami-99

@mineturtle2137
Copy link

same as @sami-99 and @geakk, RN v0.67.3 react-native-vision-camera v ^2.12.0

Details:

> Task :react-native-vision-camera:externalNativeBuildDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
261 actionable tasks: 9 executed, 252 up-to-date
BUILD FAILED in 57s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-vision-camera:externalNativeBuildDebug'.
> Build command failed.

Not sure why the thread is closed as the library fails on the android build. I tried downgrading to RN 0.66 and the solutions from other issues but nothing fixes the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃悰 bug Something isn't working
Projects
None yet
Development

No branches or pull requests