-
Notifications
You must be signed in to change notification settings - Fork 257
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
Getting "android context not initialized" error after upgrade to v2.0.0-dev.33 #1946
Comments
Hmm, so firstly, do you use any special things in Rust? e.g. something like android context. In addition, try to print as many logs as possible for that automated testing, which can be quite helpful. Also, do they provide some extra info such as full video recordings? |
Hi @fzyzcjy , I don't load any dynamic libraries any more after the upgrade (with v1 i loaded the bindings .so), just use normal Flutter packages/libraries and nothing particularly fancy. I just manged to reproduce this on a local device:
Video recording won't help as this is when the application first boots. The stack trace is from trying to create an Perhaps there is some Android specific configuration lingering from the v1 build process that is causing this, will keep looking into it. BTW, huge thanks to you and all the other contributors for FRB v2, it is sooooo much better having the build process just be another Flutter package and the generated bindings are much easier to read and reason about. Awesome work! |
Great! Btw you can setup stacktrace logging, such that we can know which exact line of Rust code causes it.
I mean, do you use some JNI function or something that indirectly needs android?
If this may be the problem, one way is to create a brand new project by |
Huh, so this was a little convoluted to figure out but I got it working. TL;DR needed to avoid using the During the upgrade I refactored from a global static I then instantiated the To work around this issue I deferred instantiating the Apologies for the noise @fzyzcjy and thanks again for all your work on the excellent v2 of FRB 👏 |
It's OK and happy to see it is solved! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue. |
Describe the bug
After upgrading to v2 I get this error reported in my crashlog from automated execution against several devices in the Play Store, here is an example crash report:
This is the device info:
Steps to reproduce
Not sure how to reproduce this as it worked fine when I tested on my local device.
Logs
Expected behavior
I expected the app to run as it did with v1.82.6.
Generated binding code
No response
OS
No response
Version of
flutter_rust_bridge_codegen
v2.0.0-dev.33
Flutter info
No response
Version of
clang++
No response
Additional context
I have looked at the information in #1323 and the linked PR but not sure I need to follow these steps as a vanilla app generated with v2
flutter_rust_bridge_codegen
does not seem to include that code.Any pointers much appreciated 🙏
The text was updated successfully, but these errors were encountered: