-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Increase logging around loading of libflutter.so #168706
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
Conversation
For my own understanding can you give an example log output that might change what this code does to fix the issue? |
For an app bundle, the output will look something like this 05-12 16:21:04.470 16731 16731 E FlutterLoader: App is using cpu architecture: aarch64, and the native libraries directory (with path /data/app/~~s0585eApe59QLdC1zYUiiw==/com.example.flutter_app_20250425_06-h2hMrlqiR3GGfRT_VRtbWw==/lib/arm64) contains the following files: [], and the split and source libraries directory (with path(s) [/data/app/~~s0585eApe59QLdC1zYUiiw==/com.example.flutter_app_20250425_06-h2hMrlqiR3GGfRT_VRtbWw==/split_config.arm64_v8a.apk!/lib/arm64-v8a, /data/app/~~s0585eApe59QLdC1zYUiiw==/com.example.flutter_app_20250425_06-h2hMrlqiR3GGfRT_VRtbWw==/split_config.en.apk!/lib/arm64-v8a, /data/app/~~s0585eApe59QLdC1zYUiiw==/com.example.flutter_app_20250425_06-h2hMrlqiR3GGfRT_VRtbWw==/split_config.xxhdpi.apk!/lib/arm64-v8a, /data/app/~~s0585eApe59QLdC1zYUiiw==/com.example.flutter_app_20250425_06-h2hMrlqiR3GGfRT_VRtbWw==/base.apk!/lib/arm64-v8a]). I went back and forth on whether it was worth reading the archived file contents in the apks - at that point, we'd basically be re-writing ReLinker. The first reason to do this is to give a more complete picture of where we are actually looking for the library. As the exception today states that it's only looking in the native library directory - which is not the full picture. I believe the benefit is to look for CPU architecture inconsistencies (for some reason if the phone is reporting the incorrect CPU arch - which seems to be the leading hypothesis as to why sometimes the libflutter.so file cannot be found in bundled installs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this fixes the unit tests which were not correctly getting the exception in the given test.
Oof thanks for fixing, in hindsight I don't know why I wrote the expect within a catch block instead of just capturing the value in the catch block and asserting outside of the block.
… into loadLibrary-168272
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
autosubmit label was removed for flutter/flutter/168706, because - The status or check suite Linux linux_web_engine_tests has failed. Please fix the issues identified (or deflake) before re-applying this label. |
Looks like engine artifacts are completed (at least for the last sha). I'll look at logs for FRoB |
autosubmit label was removed for flutter/flutter/168706, because - The status or check suite Linux linux_fuchsia_tests has failed. Please fix the issues identified (or deflake) before re-applying this label. |
Increase logging around libflutter.so. This adds debug logging to the ReLinker load call as well as more logging in the error case. The split and source dirs are added to the error message to improve troubleshooting in the app bundle case. This does not fix the error of not finding the libflutter.so file, just increases logging to hopefully help devs find their problem.
Also, this fixes the unit tests which were not correctly getting the exception in the given test.
Fixes: #168272
Pre-launch Checklist
///
).