mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.66k stars 1.11k forks source link

🐛 iOS build error: 'jsi/JSCRuntime.h' file not found #1450

Closed hoseinfo closed 1 year ago

hoseinfo commented 1 year ago

What were you trying to do?

Try to build iOS project with Xcode.

Reproduceable Code

No response

What happened instead?

I faced this issue:

'jsi/JSCRuntime.h' file not found

Relevant log output

No response

Device

iPhone14(iOS 16.2)

VisionCamera Version

2.15.4

Additional information

hoseinfo commented 1 year ago

"react-native": "0.71.1"

FDiskas commented 1 year ago

If you are not using hermes then it could help

diff --git a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h
index a428c01..663ee4b 100644
--- a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h  
+++ b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h  
@@ -22,7 +22,7 @@
   #include <v8runtime/V8RuntimeFactory.h>
 #else
   // JSC
-  #include <jsi/JSCRuntime.h>
+  #include <React_jsc/JSCRuntime.h>
 #endif

 using namespace facebook;
zzz08900 commented 1 year ago

I guess a proper title should be: Vision camera breaks on RN 0.71 with Hermes disabled.

(If you enabled Hermes the build script won't be making JSI runtime)

mikebouwmans commented 1 year ago

If you are not using hermes then it could help

diff --git a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h
index a428c01..663ee4b 100644
--- a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h    
+++ b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h    
@@ -22,7 +22,7 @@
   #include <v8runtime/V8RuntimeFactory.h>
 #else
   // JSC
-  #include <jsi/JSCRuntime.h>
+  #include <React_jsc/JSCRuntime.h>
 #endif

 using namespace facebook;

This solution would trigger React_jsc/JSCRuntime.h file not found. It should be React-jsc/JSCRuntime.h

mikebouwmans commented 1 year ago

Submitted a PR (#1456) with a fix.

AntonioLi1 commented 1 year ago

If you are not using hermes then it could help

diff --git a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h
index a428c01..663ee4b 100644
--- a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h    
+++ b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h    
@@ -22,7 +22,7 @@
   #include <v8runtime/V8RuntimeFactory.h>
 #else
   // JSC
-  #include <jsi/JSCRuntime.h>
+  #include <React_jsc/JSCRuntime.h>
 #endif

 using namespace facebook;

in which file are you adding this?

FDiskas commented 1 year ago

We are using https://www.npmjs.com/package/patch-package

hzcfy commented 1 year ago

If you are not using hermes then it could help

diff --git a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h
index a428c01..663ee4b 100644
--- a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h  
+++ b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h  
@@ -22,7 +22,7 @@
   #include <v8runtime/V8RuntimeFactory.h>
 #else
   // JSC
-  #include <jsi/JSCRuntime.h>
+  #include <React_jsc/JSCRuntime.h>
 #endif

 using namespace facebook;

This solution would trigger React_jsc/JSCRuntime.h file not found. It should be React-jsc/JSCRuntime.h

thank you

maskowe commented 1 year ago

Is there a specific android file at react-native-node_modules/react-native-vision-camera/android that can be changed with patch-package for the same fix? I'm using "react-native-vision-camera": "2.15.3" and "react-native": "0.71.3" and have hermes disabled. Thanks for any suggestions.

hzcfy commented 1 year ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

maskowe commented 1 year ago

好,谢谢

maskowe commented 1 year ago

Nevermind, found it at: node_modules\react-native-vision-camera\android\src\main\cpp\MakeJSIRuntime.h

guthriet1230 commented 1 year ago

any resolution here? running into this error on my side too :/

RN 0.71.6 react-native-vision-camera ^2.15.4

have to remove Hermes for other purposes

Jackwew commented 1 year ago

"react-native": "0.71.1"

If you are not using hermes then it could help

diff --git a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h
index a428c01..663ee4b 100644
--- a/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h    
+++ b/node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h    
@@ -22,7 +22,7 @@
   #include <v8runtime/V8RuntimeFactory.h>
 #else
   // JSC
-  #include <jsi/JSCRuntime.h>
+  #include <React_jsc/JSCRuntime.h>
 #endif

 using namespace facebook;

This solution would trigger React_jsc/JSCRuntime.h file not found. It should be React-jsc/JSCRuntime.h

thank you

I did it like you did, but it didn't work

hzcfy commented 1 year ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

m1771vw commented 1 year ago

I spent two days trying to figure out what was going on, didn't know it was a hermes thing! Thank you!

Changing this in /node_modules/react-native-vision-camera/ios/React Utils/MakeJSIRuntime.h worked

-  #include <jsi/JSCRuntime.h>
+  #include <React-jsc/JSCRuntime.h>
josh-thompson13 commented 1 year ago

@m1771vw I got the exact same "file not found" error. Only thing that makes it work is removing the line completely.

hzcfy commented 1 year ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

SkioFox commented 8 months ago

https://github.com/margelo/react-native-worklets-core/issues/150 @hzcfy could you help me any idea? above link has the detail info about the issue in similar

hzcfy commented 8 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

zpinto123 commented 7 months ago

This issue is now present on version 4.0.0/4.0.1.

hzcfy commented 7 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。