react-native-fast-tflite
react-native-fast-tflite copied to clipboard
Execution failed for task ':react-native-fast-tflite:buildCMakeDebug[arm64-v8a]
I'm trying to add this library to my react native project, but I'm getting this error when I try to run on android:
Execution failed for task ':react-native-fast-tflite:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/.cxx/Debug/17534e6g/arm64-v8a' [1/4] Building CXX object CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorHelpers.cpp.o FAILED: CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorHelpers.cpp.o /Users/francescoclementi/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android26 --sysroot=/Users/francescoclementi/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DVisionCameraTflite_EXPORTS -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/../cpp -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/src/main/cpp -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/../tensorflow -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native/ReactCommon -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native/ReactCommon/callinvoker -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native/ReactAndroid/src/main/jni/react/turbomodule -isystem /Users/francescoclementi/.gradle/caches/8.8/transforms/2cabb25e97290c266f7cc06bcb971c95/transformed/react-android-0.75.4-debug/prefab/modules/jsi/include -isystem /Users/francescoclementi/.gradle/caches/8.8/transforms/2cabb25e97290c266f7cc06bcb971c95/transformed/react-android-0.75.4-debug/prefab/modules/reactnativejni/include -isystem /Users/francescoclementi/.gradle/caches/8.8/transforms/ac24feb11b9b575f8add13c9223c40a2/transformed/fbjni-0.6.0/prefab/modules/fbjni/include -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 -fstack-protector-all -DANDROID -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorHelpers.cpp.o -MF CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorHelpers.cpp.o.d -o CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorHelpers.cpp.o -c /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorHelpers.cpp In file included from /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorHelpers.cpp:9: /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/../cpp/TensorHelpers.h:15:10: fatal error: 'tensorflow/lite/c/c_api.h' file not found #include <tensorflow/lite/c/c_api.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. [2/4] Building CXX object CMakeFiles/VisionCameraTflite.dir/src/main/cpp/Tflite.cpp.o FAILED: CMakeFiles/VisionCameraTflite.dir/src/main/cpp/Tflite.cpp.o /Users/francescoclementi/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android26 --sysroot=/Users/francescoclementi/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DVisionCameraTflite_EXPORTS -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/../cpp -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/src/main/cpp -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/../tensorflow -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native/ReactCommon -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native/ReactCommon/callinvoker -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native/ReactAndroid/src/main/jni/react/turbomodule -isystem /Users/francescoclementi/.gradle/caches/8.8/transforms/2cabb25e97290c266f7cc06bcb971c95/transformed/react-android-0.75.4-debug/prefab/modules/jsi/include -isystem /Users/francescoclementi/.gradle/caches/8.8/transforms/2cabb25e97290c266f7cc06bcb971c95/transformed/react-android-0.75.4-debug/prefab/modules/reactnativejni/include -isystem /Users/francescoclementi/.gradle/caches/8.8/transforms/ac24feb11b9b575f8add13c9223c40a2/transformed/fbjni-0.6.0/prefab/modules/fbjni/include -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 -fstack-protector-all -DANDROID -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/VisionCameraTflite.dir/src/main/cpp/Tflite.cpp.o -MF CMakeFiles/VisionCameraTflite.dir/src/main/cpp/Tflite.cpp.o.d -o CMakeFiles/VisionCameraTflite.dir/src/main/cpp/Tflite.cpp.o -c /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/src/main/cpp/Tflite.cpp In file included from /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/src/main/cpp/Tflite.cpp:7: /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/../cpp/TensorflowPlugin.h:19:10: fatal error: 'tensorflow/lite/c/c_api.h' file not found #include <tensorflow/lite/c/c_api.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. [3/4] Building CXX object CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorflowPlugin.cpp.o FAILED: CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorflowPlugin.cpp.o /Users/francescoclementi/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android26 --sysroot=/Users/francescoclementi/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DVisionCameraTflite_EXPORTS -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/../cpp -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/src/main/cpp -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/../tensorflow -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native/ReactCommon -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native/ReactCommon/callinvoker -I/Users/francescoclementi/parkingless-mobile/node_modules/react-native/ReactAndroid/src/main/jni/react/turbomodule -isystem /Users/francescoclementi/.gradle/caches/8.8/transforms/2cabb25e97290c266f7cc06bcb971c95/transformed/react-android-0.75.4-debug/prefab/modules/jsi/include -isystem /Users/francescoclementi/.gradle/caches/8.8/transforms/2cabb25e97290c266f7cc06bcb971c95/transformed/react-android-0.75.4-debug/prefab/modules/reactnativejni/include -isystem /Users/francescoclementi/.gradle/caches/8.8/transforms/ac24feb11b9b575f8add13c9223c40a2/transformed/fbjni-0.6.0/prefab/modules/fbjni/include -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 -fstack-protector-all -DANDROID -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorflowPlugin.cpp.o -MF CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorflowPlugin.cpp.o.d -o CMakeFiles/VisionCameraTflite.dir/Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorflowPlugin.cpp.o -c /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorflowPlugin.cpp In file included from /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/cpp/TensorflowPlugin.cpp:9: /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/../cpp/TensorflowPlugin.h:19:10: fatal error: 'tensorflow/lite/c/c_api.h' file not found #include <tensorflow/lite/c/c_api.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ninja: build stopped: subcommand failed. C++ build system [build] failed while executing: /Users/francescoclementi/Library/Android/sdk/cmake/3.22.1/bin/ninja \ -C \ /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android/.cxx/Debug/17534e6g/arm64-v8a \ VisionCameraTflite from /Users/francescoclementi/parkingless-mobile/node_modules/react-native-fast-tflite/android * Try:
I already tried deleted android/.gradle, clean the project, fresh install etc.
"react-native-vision-camera": "^4.5.3", "react-native": "^0.75.4", "react-native-fast-tflite": "^1.4.0",