Kudo / react-native-v8

Opt-in V8 runtime for React Native Android
MIT License
914 stars 69 forks source link

RN 0.69.5 + Reanimated 2.10 on Android #135

Closed terfender closed 2 years ago

terfender commented 2 years ago

Hello, I am getting the following error. How to fix it?

MacOS: 12.5.1

package.json

    "react": "18.0.0",
    "react-native": "0.69.5",
    "react-native-reanimated": "^2.10.0",
    "react-native-v8": "^1.4.7",
    "v8-android-jit": "^10.100.1
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-v8:buildCMakeRelWithDebInfo[arm64-v8a]'.
> Build command failed.
  Error while executing process /Users/xxxxx/Library/Android/sdk/cmake/3.18.1/bin/ninja with arguments {-C /Users/xxxxx/rnrn/node_modules/react-native-v8/android/.cxx/RelWithDebInfo/704c2c2o/arm64-v8a v8executor}
  ninja: Entering directory `/Users/xxxxx/rnrn/node_modules/react-native-v8/android/.cxx/RelWithDebInfo/704c2c2o/arm64-v8a'
  [1/14] Building CXX object CMakeFiles/reactnative_internal_static.dir/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/reactperflogger/reactperflogger/BridgeNativeModulePerfLogger.cpp.o
  [2/14] Building CXX object CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8PointerValue.cpp.o
  [3/14] Building CXX object CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8RuntimeFactory.cpp.o
  [4/14] Building CXX object CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/JSIV8ValueConverter.cpp.o
  [5/14] Building CXX object CMakeFiles/reactnative_internal_static.dir/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/cxxreact/JSExecutor.cpp.o
  [6/14] Building CXX object CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/HostProxy.cpp.o
  [7/14] Building CXX object CMakeFiles/v8executor.dir/src/main/cpp/V8ExecutorFactory.cpp.o
  [8/14] Building CXX object CMakeFiles/reactnative_internal_static.dir/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp.o
  [9/14] Building CXX object CMakeFiles/v8executor.dir/src/main/cpp/OnLoad.cpp.o
  [10/14] Building CXX object CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o
  [11/14] Building CXX object CMakeFiles/reactnative_internal_static.dir/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp.o
  [12/14] Linking CXX static library libreactnative_internal_static.a
  [13/14] Building CXX object CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Inspector.cpp.o
  [14/14] Linking CXX shared library ../../../../build/intermediates/cxx/RelWithDebInfo/704c2c2o/obj/arm64-v8a/libv8executor.so
  FAILED: ../../../../build/intermediates/cxx/RelWithDebInfo/704c2c2o/obj/arm64-v8a/libv8executor.so 
  : && /Users/xxxxx/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --sysroot=/Users/xxxxx/Library/Android/sdk/ndk/25.1.8937393/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 -DREACT_NATIVE_TARGET_VERSION=69 -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -DV8_COMPRESS_POINTERS -O2 -g -DNDEBUG  -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--gc-sections -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libv8executor.so -o ../../../../build/intermediates/cxx/RelWithDebInfo/704c2c2o/obj/arm64-v8a/libv8executor.so CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/HostProxy.cpp.o CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/JSIV8ValueConverter.cpp.o CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Inspector.cpp.o CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8PointerValue.cpp.o CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8RuntimeFactory.cpp.o CMakeFiles/v8executor.dir/src/main/cpp/V8ExecutorFactory.cpp.o CMakeFiles/v8executor.dir/src/main/cpp/OnLoad.cpp.o -L/Users/xxxxx/rnrn/node_modules/react-native-v8/android/build/jniLibs/react/jni/arm64-v8a   -L/Users/xxxxx/rnrn/node_modules/react-native-v8/android/build/jniLibs/v8/jni/arm64-v8a -llog  -ljsi  -ljsinspector  /usr/local/lib/libglog.a  -lfbjni  -lfolly_runtime  -lreactnativejni  -lv8android  libreactnative_internal_static.a  -landroid  -lfolly_runtime  -latomic -lm && :
  ld: error: undefined symbol: google::LogMessage::LogMessage(char const*, int, int)
  >>> referenced by V8Runtime.cpp:106 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:106)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::V8Runtime(rnv8::V8Runtime const*, std::__ndk1::unique_ptr<rnv8::V8RuntimeConfig, std::__ndk1::default_delete<rnv8::V8RuntimeConfig> >))
  >>> referenced by V8Runtime.cpp:360 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:360)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::SaveCodeCacheIfNeeded(v8::Local<v8::Script> const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, v8::ScriptCompiler::CachedData*))
  >>> referenced by OnLoad.cpp:45 (../../../../src/main/cpp/OnLoad.cpp:45)
  >>>               CMakeFiles/v8executor.dir/src/main/cpp/OnLoad.cpp.o:(rnv8::loadBlob(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::react::JAssetManager, facebook::jni::JObject, void>::_javaobject*>, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&))
  >>> referenced 1 more times

  ld: error: undefined symbol: google::LogMessage::stream()
  >>> referenced by V8Runtime.cpp:106 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:106)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::V8Runtime(rnv8::V8Runtime const*, std::__ndk1::unique_ptr<rnv8::V8RuntimeConfig, std::__ndk1::default_delete<rnv8::V8RuntimeConfig> >))
  >>> referenced by V8Runtime.cpp:182 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:182)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::ExecuteScript(v8::Isolate*, v8::Local<v8::String> const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&))
  >>> referenced by V8Runtime.cpp:314 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:314)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::LoadCodeCacheIfNeeded(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&))
  >>> referenced 8 more times

  ld: error: undefined symbol: google::LogMessage::~LogMessage()
  >>> referenced by V8Runtime.cpp:106 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:106)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::V8Runtime(rnv8::V8Runtime const*, std::__ndk1::unique_ptr<rnv8::V8RuntimeConfig, std::__ndk1::default_delete<rnv8::V8RuntimeConfig> >))
  >>> referenced by V8Runtime.cpp:106 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:106)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::V8Runtime(rnv8::V8Runtime const*, std::__ndk1::unique_ptr<rnv8::V8RuntimeConfig, std::__ndk1::default_delete<rnv8::V8RuntimeConfig> >))
  >>> referenced by V8Runtime.cpp:182 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:182)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::ExecuteScript(v8::Isolate*, v8::Local<v8::String> const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&))
  >>> referenced 10 more times

  ld: error: undefined symbol: google::LogMessage::LogMessage(char const*, int)
  >>> referenced by V8Runtime.cpp:182 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:182)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::ExecuteScript(v8::Isolate*, v8::Local<v8::String> const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&))
  >>> referenced by V8Runtime.cpp:314 (/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp:314)
  >>>               CMakeFiles/v8executor.dir/Users/xxxxx/rnrn/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o:(rnv8::V8Runtime::LoadCodeCacheIfNeeded(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&))
  >>> referenced by JSIExecutor.cpp:364 (/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp:364)
  >>>               JSIExecutor.cpp.o:(facebook::react::JSIExecutor::handleMemoryPressure(int)) in archive libreactnative_internal_static.a
  >>> referenced 1 more times

  ld: error: undefined symbol: google::LogMessageFatal::LogMessageFatal(char const*, int)
  >>> referenced by JSIExecutor.cpp:411 (/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp:411)
  >>>               JSIExecutor.cpp.o:(facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool)) in archive libreactnative_internal_static.a
  >>> referenced by JSINativeModules.cpp:91 (/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp:91)
  >>>               JSINativeModules.cpp.o:(facebook::react::JSINativeModules::createModule(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)) in archive libreactnative_internal_static.a
  >>> referenced by JSINativeModules.cpp:92 (/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp:92)
  >>>               JSINativeModules.cpp.o:(facebook::react::JSINativeModules::createModule(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)) in archive libreactnative_internal_static.a

  ld: error: undefined symbol: google::LogMessageFatal::~LogMessageFatal()
  >>> referenced by JSIExecutor.cpp:411 (/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp:411)
  >>>               JSIExecutor.cpp.o:(facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool)) in archive libreactnative_internal_static.a
  >>> referenced by JSIExecutor.cpp:411 (/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp:411)
  >>>               JSIExecutor.cpp.o:(facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool)) in archive libreactnative_internal_static.a
  >>> referenced by JSINativeModules.cpp:0 (/Users/xxxxx/rnrn/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp:0)
  >>>               JSINativeModules.cpp.o:(facebook::react::JSINativeModules::createModule(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)) in archive libreactnative_internal_static.a
  >>> referenced 2 more times
  clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.
Kudo commented 2 years ago

hi there! i'm sorry that the minimum support of react-native-v8@v1 is react-native 0.66. please consider to upgrade your react-native if possible. thanks!

terfender commented 2 years ago

Thanks for the quick response @Kudo . I am using RN 0.69.5, the latest stable version so far.

Please check my package.json and let me know if I am missing something.

Thanks again.

Kudo commented 2 years ago

oh sorry i misread the description. let me reopen this and i'll check it.

lkinasiewicz commented 2 years ago

Hi, I also have a problem with building reanimated 2.10.0 with react-native-v8@1.4.7 and react-native-tvos@0.68.2-6. Logs from android studio:

> Configure project :react-native-reanimated
Native libs debug enabled: false
Android gradle plugin: 7.2.2
Gradle: 7.3.3
building Reanimated2

> Task :prepareKotlinBuildScriptModel UP-TO-DATE
C/C++: debug|x86 :CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
C/C++: debug|x86 :Please set them or make sure they are set and tested correctly in the CMake files:
C/C++: debug|x86 :V8EXECUTOR_LIB
C/C++: debug|x86 :    linked by target "reanimated" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-reanimated/android
C/C++: debug|x86 :CMake Generate step failed.  Build files cannot be regenerated correctly.
[CXX1405] error when building with cmake using /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-reanimated/android/CMakeLists.txt: Build command failed.
Error while executing process /Users/lukasz.kinasiewicz/Library/Android/sdk/cmake/3.18.1/bin/cmake with arguments {-H/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-reanimated/android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=22 -DANDROID_PLATFORM=android-22 -DANDROID_ABI=x86 -DCMAKE_ANDROID_ARCH_ABI=x86 -DANDROID_NDK=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_ANDROID_NDK=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=/Users/lukasz.kinasiewicz/Library/Android/sdk/cmake/3.18.1/bin/ninja -DCMAKE_CXX_FLAGS=-fstack-protector-all -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-reanimated/android/build/intermediates/cxx/Debug/5716g4op/obj/x86 -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-reanimated/android/build/intermediates/cxx/Debug/5716g4op/obj/x86 -DCMAKE_BUILD_TYPE=Debug -B/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-reanimated/android/.cxx/Debug/5716g4op/x86 -GNinja -DANDROID_STL=c++_shared -DNATIVE_DEBUG=false -DREACT_NATIVE_TARGET_VERSION=68 -DANDROID_TOOLCHAIN=clang -DBOOST_VERSION=1_63_0 -DNODE_MODULES_DIR=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules -DJS_RUNTIME=v8 -DJS_RUNTIME_DIR=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8 -DCLIENT_SIDE_BUILD=true -DIS_NEW_ARCHITECTURE_ENABLED=false -DPLAYGROUND_APP_NAME=native -DRNVERSION=68}
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - 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: /Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
V8EXECUTOR_LIB
    linked by target "reanimated" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-reanimated/android

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

C/C++: debug|x86 :CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
C/C++: debug|x86 :Please set them or make sure they are set and tested correctly in the CMake files:
C/C++: debug|x86 :FBJNI_LIB
C/C++: debug|x86 :    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
C/C++: debug|x86 :FOLLY_LIB
C/C++: debug|x86 :    linked by target "reactnative_internal_static" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
C/C++: debug|x86 :    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
C/C++: debug|x86 :GLOG_LIB
C/C++: debug|x86 :    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
C/C++: debug|x86 :JSINSPECTOR_LIB
C/C++: debug|x86 :    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
C/C++: debug|x86 :JSI_LIB
C/C++: debug|x86 :    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
C/C++: debug|x86 :REACT_NATIVE_JNI_LIB
C/C++: debug|x86 :    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
C/C++: debug|x86 :V8_ANDROID_LIB
C/C++: debug|x86 :    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
C/C++: debug|x86 :CMake Generate step failed.  Build files cannot be regenerated correctly.
[CXX1405] error when building with cmake using /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android/CMakeLists.txt: Build command failed.
Error while executing process /Users/lukasz.kinasiewicz/Library/Android/sdk/cmake/3.18.1/bin/cmake with arguments {-H/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=22 -DANDROID_PLATFORM=android-22 -DANDROID_ABI=x86 -DCMAKE_ANDROID_ARCH_ABI=x86 -DANDROID_NDK=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_ANDROID_NDK=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=/Users/lukasz.kinasiewicz/Library/Android/sdk/cmake/3.18.1/bin/ninja -DCMAKE_CXX_FLAGS=-fstack-protector-all -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android/build/intermediates/cxx/Debug/5k691h4q/obj/x86 -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android/build/intermediates/cxx/Debug/5k691h4q/obj/x86 -DCMAKE_BUILD_TYPE=Debug -B/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android/.cxx/Debug/5k691h4q/x86 -GNinja -DANDROID_STL=c++_shared -DBOOST_VERSION=1_63_0 -DBUILD_DIR=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android/build -DRN_DIR=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native -DREACT_NATIVE_TARGET_VERSION=68 -DV8_ANDROID_DIR=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/v8-android-jit -DSO_DIR=/Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android/build/jniLibs}
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - 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: /Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FBJNI_LIB
    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
FOLLY_LIB
    linked by target "reactnative_internal_static" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
GLOG_LIB
    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
JSINSPECTOR_LIB
    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
JSI_LIB
    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
REACT_NATIVE_JNI_LIB
    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android
V8_ANDROID_LIB
    linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/nitrox5/node_modules/react-native-v8/android

CMake Generate step failed.  Build files cannot be regenerated correctly.
Kudo commented 2 years ago

i've tried to build in on a rn 69.5 + reanimated 2.10 project and it works for me. could you provide a minimal reproducible example for me to further investigate?

terfender commented 2 years ago

@Kudo , thanks for looking into it.

Here is the bare minimum repo to reproduce the issue on my end. https://github.com/Terfender/rnrn

system:
    OS: macOS 12.5.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 2.00 GB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.13.1 - /usr/local/bin/node
    Yarn: 1.22.17 - ~/.node/bin/yarn
    npm: 8.4.1 - ~/.node/bin/npm
    Watchman: 2022.08.22.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 29
      Build Tools: 29.0.2
      Android NDK: 22.1.7171670
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.5 => 0.69.5 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

BTW, in my local.properties, I set NDK version to 25.1.8937393 (I had to do it to get around with Reanimted building issue). However, react-native info says I am using Android NDK: 22.1.7171670. Not sure if this conflict has anything to do with the error.

I appreciate for looking into my issue.

Update:

Kudo commented 2 years ago

@Terfender thanks for the help. unfortunately, i cloned the example with ndk 25.1.8937393 and it still works for me 🤔. i may get the problem from your build error log. it looks the linker was linking to your /usr/local/lib/libglog.a. could you double check whether you have this file and why this was installed?

terfender commented 2 years ago

worked after deleting /usr/local/lib/libglog.a Not sure what it is used for. Created on January 14, 2019 tho

Thanks for your help.