Skip to content
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

🐛 iOS crashes when reloading JS bundle and using useFrameProcessor #675

Closed
ghost opened this issue Dec 24, 2021 · 4 comments · Fixed by #684
Closed

🐛 iOS crashes when reloading JS bundle and using useFrameProcessor #675

ghost opened this issue Dec 24, 2021 · 4 comments · Fixed by #684
Labels
🐛 bug Something isn't working

Comments

@ghost
Copy link

ghost commented Dec 24, 2021

What were you trying to do?

Enable "frameProcessor", app will be crashed after run Reload JS (from debug menu) or CodePush.restartApp().
Seem like the "FrameProcessor" doesn't cleanup if we reload js bundle.

Reproduceable Code

No response

What happened instead?

No Crash

Relevant log output

2021-12-24 18:47:33.428793+0700 exampleapp[8524:2122342] FrameProcessorBindings: Successfully created worklet!
2021-12-24 18:47:33.495720+0700 exampleapp[8524:2122338] FrameProcessorBindings: Converting worklet to Objective-C callback...
2021-12-24 18:47:33.498141+0700 exampleapp[8524:2122338] FrameProcessorBindings: Frame processor set!
2021-12-24 18:47:33.654409+0700 exampleapp[8524:2122340] <Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
2021-12-24 18:47:33.686432+0700 exampleapp[8524:2122339] [native] VisionCamera.didSetProps(_:): Started Session!
libc++abi: terminating with uncaught exception of type facebook::jsi::JSError: Exception in HostFunction: Javascript worklet error

Error: Javascript worklet error
    at _f (native)

Error: Exception in HostFunction: Javascript worklet error

Error: Javascript worklet error
    at _f (native)
    at _f (native)
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
terminating with uncaught exception of type facebook::jsi::JSError: Exception in HostFunction: Javascript worklet error

Error: Javascript worklet error
    at _f (native)

Error: Exception in HostFunction: Javascript worklet error

Error: Javascript worklet error
    at _f (native)
    at _f (native)
(lldb)  


### Device

iPhone

### VisionCamera Version

2.10.0

### Additional information

- [ ] I am using Expo
- [X] I have read the [Troubleshooting Guide](https://mrousavy.github.io/react-native-vision-camera/docs/guides/troubleshooting)
- [X] I agree to follow this project's [Code of Conduct](https://github.com/mrousavy/react-native-vision-camera/blob/main/CODE_OF_CONDUCT.md)
- [X] I searched for [similar issues in this repository](https://github.com/mrousavy/react-native-vision-camera/issues) and found none.
@ghost ghost added the 🐛 bug Something isn't working label Dec 24, 2021
@ghost ghost changed the title 🐛 use useFrameProcessor 🐛 Crashed after reload bundle when use useFrameProcessor Dec 24, 2021
@ghost ghost changed the title 🐛 Crashed after reload bundle when use useFrameProcessor 🐛 iOS crashes when reloading JS bundle and using useFrameProcessor Dec 24, 2021
@ghost ghost closed this as completed Dec 24, 2021
@ghost ghost reopened this Dec 24, 2021
@ghost
Copy link
Author

ghost commented Dec 24, 2021

Seem like the Frame Processor Plugins are not injected into the VisionCamera JS-Runtime after Js Bundle reloaded. They are injected in the first time only.

@ghost
Copy link
Author

ghost commented Dec 26, 2021

close due to dupplicated #626

@ghost ghost closed this as completed Dec 26, 2021
@mrousavy
Copy link
Owner

Hm, I see. This probably has to be moved to the same setup code as the JSI funcs

@ghost
Copy link
Author

ghost commented Dec 27, 2021

Hm, I see. This probably has to be moved to the same setup code as the JSI funcs

I removed the line [FrameProcessorPluginRegistry markInvalid]; from initWithBridge and it's working well on iOS.
Now I'm facing the same problem with #570 and #500 on Android.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant