-
-
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
Delay frame processor initialization until view creation on Android #1583
Delay frame processor initialization until view creation on Android #1583
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks for creating this PR! |
Hey! Thanks for creating this PR, but I don't think that this is the right approach to this problem. This just swallows the error and silently fails when you try to use FPs on the JS side later on. Also, this elevates the internal setup from internal ( |
In V3 I have a different solution here which is called from JS - so this is when the JS bundle is 100% ready. That's probably what we want. Sorry for closing this PR please don't take it personal ❤️ |
Hmm... this patch was written against current main, which is not yet V3. Why not allow this backport until V3 is production ready? |
Because of this:
the FP runtime will not be installed and will just not work. You can disable FPs at build time if that's what you want |
Okay sure, I get what you mean. Do you have another approach in mind on how to fix it? Before v3 is ready and adopted? Edit: Actually, I'm not sure I fully agree. It doesn't just swallow the error. The error should not happen since the fp init happens at a later stage, right? |
If you do not need Frame Processors, just disable them at build time. If you do, then I am not sure - I think the solution in V3 is much more solid since it does init from JS side - but this is a big change
No, it is wrapped in a |
What
This PR fixes java.lang.NullPointerException in FrameProcessorRuntimeManager. on Android phones
Although I never was able to reproduce the issue myself, looking at the crashlogs from other users, this should fix it
Changes
Moved the creation
FrameProcessorRuntimeManager
to happen inonCreateViewInstance
instead of insideCameraViewModule
initialisation. This should make sure that the react context is fully initialised, which apparently is not the case right nowInspired by @pke in #946 (comment)
Tested on
Not properly tested yet. I'm having trouble building and running the example app from this repo. I have tested it in another app which uses this library. Any help to test and verify the change is greatly appreciated
Related issues
Fixes #946