margelo / margelo/react-native-fast-tflite

Execution failed for task ':react-native-fast-tflite:buildCMakeDebug[arm64-v8a]

Open
#99 22 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.2k
Forks
92
Avg merge
13h 9m
Merged PRs (30d)
2

Description

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",

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Android build and inspect the include paths shown for cpp/TensorHelpers.cpp, cpp/TensorflowPlugin.cpp, and android/src/main/cpp/Tflite.cpp. Check why tensorflow/lite/c/c_api.h is not found, then verify the build completes for arm64-v8a with the listed React Native and react-native-fast-tflite versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cmake, cpp, react-native, tensorflow
Domain
build-system, machine-learning, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.