serenity-kit / react-native-libsodium

React Native bindings to Libsodium matching the libsodium-wrappers package API
MIT License
30 stars 9 forks source link

[CXX1429] error when building with cmake using #45

Closed burhon97 closed 1 year ago

burhon97 commented 1 year ago

I create new React-Native app and install the pakcage react-native-libsodium and run project. Error when run project React-Native on android npm run android:

BUILD FAILED in 17s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':react-native-libsodium:configureCMakeDebug[arm64-v8a]'.
> [CXX1429] error when building with cmake using /Users/code_joker/Documents/react-native-libsodium/exampleMy/node_modules/react-native-libsodium/android/CMakeLists.txt: -- Android: Targeting API '21' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64' -- 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: /Users/code_joker/Library/Android/sdk/ndk/23.1.7779620/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/code_joker/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done C++ build system [configure] failed while executing: /Users/code_joker/Library/Android/sdk/cmake/3.22.1/bin/cmake \ -H/Users/code_joker/Documents/react-native-libsodium/exampleMy/node_modules/react-native-libsodium/android \ -DCMAKE_SYSTEM_NAME=Android \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_SYSTEM_VERSION=21 \ -DANDROID_PLATFORM=android-21 \ -DANDROID_ABI=arm64-v8a \ -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ -DANDROID_NDK=/Users/code_joker/Library/Android/sdk/ndk/23.1.7779620 \ -DCMAKE_ANDROID_NDK=/Users/code_joker/Library/Android/sdk/ndk/23.1.7779620 \ -DCMAKE_TOOLCHAIN_FILE=/Users/code_joker/Library/Android/sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake \ -DCMAKE_MAKE_PROGRAM=/Users/code_joker/Library/Android/sdk/cmake/3.22.1/bin/ninja \ "-DCMAKE_CXX_FLAGS=-O2 -frtti -fexceptions -Wall -fstack-protector-all" \ -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/code_joker/Documents/react-native-libsodium/exampleMy/node_modules/react-native-libsodium/android/build/intermediates/cxx/Debug/h3q525i6/obj/arm64-v8a \ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/code_joker/Documents/react-native-libsodium/exampleMy/node_modules/react-native-libsodium/android/build/intermediates/cxx/Debug/h3q525i6/obj/arm64-v8a \ -DCMAKE_BUILD_TYPE=Debug \ -B/Users/code_joker/Documents/react-native-libsodium/exampleMy/node_modules/react-native-libsodium/android/.cxx/Debug/h3q525i6/arm64-v8a \ -GNinja \ -DANDROID_STL=c++_shared from /Users/code_joker/Documents/react-native-libsodium/exampleMy/node_modules/react-native-libsodium/android CMake Warning (dev) in CMakeLists.txt: No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as project(ProjectName) near the top of the file, but after cmake_minimum_required(). CMake is pretending there is a "project(Project)" command on the first line. This warning is for project developers. Use -Wno-dev to suppress it. CMake Error at CMakeLists.txt:34 (add_library): Cannot find source file: ../node_modules/react-native/ReactCommon/jsi/jsi/jsi.cpp Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc CMake Error at CMakeLists.txt:34 (add_library): No SOURCES given to target: libsodium CMake Generate step failed. Build files cannot be regenerated correctly.

Versions

nikgraf commented 1 year ago

@burhon97 thanks for reporting! just release 1.1.1 which should fix the issue due https://github.com/serenity-kit/react-native-libsodium/pull/47

Would appreciate if you can let me know that it works for you.

emenocal07 commented 1 year ago

I just experienced the issue a couple hours ago and saw the release was not ready yet, in the mean time patched the lib. I'll try the new version and let you now, thanks @nikgraf !

emenocal07 commented 1 year ago

Android build compiles @nikgraf, thanks again!

nikgraf commented 1 year ago

glad to you hear @emenocal07 👍

will close the issue, feel free to reopen in case it's not solved for someone