react-native-vision-camera: ❓ 2.8.0 > 2.9.1 - Android build error: JSI_LIB not found
Question
Hi,
I’m attempting to upgrade from RNVC 2.8 > 2.9 and hitting a build error:
Execution failed for task ':react-native-vision-camera:generateJsonModelDebug'.
> C:\dev\MeshMobile\node_modules\react-native-vision-camera\android\CMakeLists.txt : C/C++ debug|arm64-v8a : 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:
JSI_LIB
linked by target "VisionCamera" in directory C:/dev/MeshMobile/node_modules/react-native-vision-camera/android
Observations:
- No problems with 2.8.xx.
- Seems to only affect 2.9.0 and 2.9.1
- I’m not seeing this error when building the example app
- Affecting multiple projects (all based on boilerplate provided by
npx react-native init ProjectName
)
Repo+branch demonstrating the issue here
Full Build Log: rnvc2.9.1-build-error.log
The offending CMakeLists.txt: ~\node_modules\react-native-vision-camera\android\CMakeLists.txt
I’m stumped. Any thoughts on what I’m doing wrong?
What I tried
- Read the install instructions
- Tested all releases of RNVC from 2.8.0 onwards
- Enable/disable hermes in build.gradle
- Set compileSdkVersion to 31
- Set targetSdkVersion to 31
- Add android:exported to main activity
- cd android && gradlew clean
- Build via
npm run android
and Android Studio
VisionCamera Version
2.9.0 and 2.9.1
Additional information
- I am using Expo
- I have read the Troubleshooting Guide
- I agree to follow this project’s Code of Conduct
- I searched for similar questions in the issues page as well as in the discussions page and found none.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 7
- Comments: 28 (5 by maintainers)
Any update on this issue? Still doesn’t work on Android.
To patch this, you need to remove these:
https://github.com/mrousavy/react-native-vision-camera/blob/3315f51faf380dff7c9d57c174c489f65f376081/android/CMakeLists.txt#L90-L95
and this:
https://github.com/mrousavy/react-native-vision-camera/blob/3315f51faf380dff7c9d57c174c489f65f376081/android/CMakeLists.txt#L128
line in your local node_modules. I’ll try to figure out a way to make that CMake dependency optional…
@TheEhsanSarshar update to version 2.9.4 this is solved.
here is the juicy part about this error
here is the full error
[android, didn’t check iOS] I’m getting same issue even I tried that patch solutions… Where should I fix?
errors in terminal with patch package solution
errors without patch package solution
In previous issues, there was a bug that 2.9.0/2.9.1 was working only with RN 66, but RN 66 currently doesn’t work with the current version react-native-reanimated.
I’m on RN 0.64.2. After i saw this issue #957 , I’ve updated the library to v2.13.0 and worked on Android. But for now, I need to use v2.10.0 for iOS builds (with XCode 12) #716 and v 2.13.0 for android.
I’ll try to build with v2.13.0 in iOS with XCode 13.
Thank you so much @Hajan39
Thanks for the tip @Hajan39 , didn’t see that.
Downgrading
react-native-reanimated
to 2.3.0-beta.2 got me past the build error.