margelo / margelo/react-native-fast-tflite

Got some CMake error while compiling the project using react-native-fast-tflite

Open
#141 1 comment 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 getting the following error while syncing my project. The error is:
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:
TFLITE
linked by target "VisionCameraTflite" in directory C:/Data/Projects/react_native/robot-core-adv/node_modules/react-native-fast-tflite/android
TFLITE_GPU
linked by target "VisionCameraTflite" in directory C:/Data/Projects/react_native/robot-core-adv/node_modules/react-native-fast-tflite/android

I'm doing with Expo project, with the packages list below:

"react-native-fast-tflite": "^1.6.1",
"react-native-vision-camera": "^4.6.4",
"react-native-worklets-core": "^1.5.0",
"vision-camera-resize-plugin": "^3.2.0"

I also looked CMakeLists.txt and found related lines:

find_library(
  TFLITE
  tensorflowlite_jni
  PATHS "./src/main/cpp/lib/litert/jni/${ANDROID_ABI}"
  NO_DEFAULT_PATH
  NO_CMAKE_FIND_ROOT_PATH
)

find_library(
  TFLITE_GPU
  tensorflowlite_gpu_jni
  PATHS "./src/main/cpp/lib/litert/jni/${ANDROID_ABI}"
  NO_DEFAULT_PATH
  NO_CMAKE_FIND_ROOT_PATH
)

Seems like "lib/litert/jni/${ANDROID_ABI}" doesn't exist inside "./src/main/cpp/"

The source code I create is in https://github.com/tseng91301/robot-core-adv/tree/image-detection-using-3rd-party-package , maybe some modules conflicted? The error risen after installing react-native-worklets-core into the project.

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 with android/CMakeLists.txt and the find_library definitions for TFLITE and TFLITE_GPU, then inspect whether src/main/cpp/lib/litert/jni/${ANDROID_ABI} exists in react-native-fast-tflite 1.6.1. Reproduce the Expo Android sync with the listed packages; done means both variables resolve and the project builds without the CMake NOTFOUND errors.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.