-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Vision Camera crashes when built with Xcode 14 #1244
Comments
Hello @jpudysz, could you add your react-native/react-native-vision-camera versions please ? :) |
Sure!
|
Similar issue here. [javascript] Frame Processor threw an error: Can't find variable: __xxxx |
I'm able to reproduce the issue (repro https://github.com/baylesa-dev/rn_vision_camera_xcode_14) Edit: Just tried with https://github.com/mrousavy/vision-camera-image-labeler, and it works perfectly: the issue seems to be related to the swift implementation of https://github.com/rodgomesc/vision-camera-code-scanner |
Nice catch @baylesa-dev! |
Yep! console.log(typeof __labelImage) // => function
console.log(typeof __scanCodes) // => undefined |
I also checked vision-camera-face-detector, and it crashed immediately. The only difference between all these plugins is that I suspect that |
Mentioned in facebook/react-native#34673 (comment) |
Same here, any more info we can provide to help patch this? Or is there a temp workaround? |
So far, nothing I'm aware of. We need to wait for a patch from react-native. |
Thanks @jpudysz , I can confirm downgrading to version 13.4 solves the issue for now. I'll also keep this thread updated if I hear any updates or workarounds. Thanks! 👍 |
I have this issue after upgrading RN to 0.70.1 I made a repo to reproduce the issue. In my case, |
Thanks, I confirm that this solution works, for me is just a temporary workaround, because I need to deploy to the latest iOS, so I had to downgrade to Xcode 13.4 and then add support for iOS 16.0 Hope this will be fixed also for the latest Xcode version In this thread you can find, how to add support |
VISION_EXPORT_SWIFT_FRAME_PROCESSOR is working on my main Project, but not working in pod project like vision-camera-code-scanner when build by Xcode 14.0. If I chagne this code then it work (temporary). I tested it. |
Thanks @intmain , it fixed the issue for me temporarily too. It seems that using attribute((constructor)) no longer works with load() and not sure why swift bridge to objc works (using +(void)load ) (I'm not familiar with swift, so if I was wrong with something, please correct me.) |
Can you please provide more information on how to modify the code and where, so we can apply it also? Thank you |
@Neklan diff --git a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h
index a2ccdcb4..7c9690e0 100644
--- a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h
+++ b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h
@@ -53,7 +53,7 @@ objc_name : NSObject<FrameProcessorPluginBase>
@end \
@implementation objc_name (FrameProcessorPlugin) \
\
-__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)() \
++(void)load \
{ \
[FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) { \
return [objc_name callback:frame withArgs:args]; \ Sadly, it didn't fix my problem with custom frame processor #1244 (comment). Or those problems are irrelevant to each other. |
Thanks man, issue fixed too. |
The method posted by @intmain only solves crashes caused by upgrading to Xcode 14 - which means if you're having problems with Xcode 13.x, then the problems are probably elsewhere. Hmm, I took a look at your frame processor and it seems you didn't add any code besides the example in doc. If that is the case then I suggest you open a separate issue and ask for help there. |
I confirm, that solution posted above with changing |
this fixed the issue for me as well |
Same issue in android, please help me . Have switched back to react native camera which is deprecated. |
how can i make and use that script |
@ikuruzum all you need to do is googling "how to use patch-package" |
This issue has nothing to do with android, you're facing a different problem |
I confirm that using the patch above works with Xcode 14.0.1 :) I had no problem when using Objective-C for the iOS native module, but as soon as you use Swift, you need to apply that patch. |
Huh, that's interesting. I'll take a look to find out if that's safe to do |
Could you create a PR with the change? |
@intmain thank you so much! |
What were you trying to do?
I was trying to build my app with Xcode 14.
Reproduceable Code
What happened instead?
The app crashed with an error from HostFunction.
I can confirm that code works as expected when built with Xcode 13.
Relevant log output
Null pointer exception
The text was updated successfully, but these errors were encountered: