在我的 OnePlus 6 上调试我的 flutter 应用程序时,我收到了很多奇怪的消息。当我单击按钮、滑动等操作时会出现这些消息。我在使用 Android Pie。
一些消息:
E/libc (10995): Access denied finding property
"vendor.debug.egl.swapinterval"
W/1.gpu (10995): type=1400 audit(0.0:2806794): avc: denied { read } for
name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=21671
scontext=u:r:untrusted_app_27:s0:c512,c768
tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
E/libc (10995): Access denied finding property
"vendor.debug.egl.swapinterval"
E/libc (10995): Access denied finding property
"vendor.debug.egl.swapinterval"
E/libc (10995): Access denied finding property
"vendor.debug.egl.swapinterval"
E/libc (10995): Access denied finding property
"vendor.debug.egl.swapinterval"
W/1.gpu (10995): type=1400 audit(0.0:2806805): avc: denied { read } for
我如何摆脱它们,该应用程序似乎运行良好。很难阅读所有这些困惑的 print() 消息。
最佳答案
解决方法是使用 Flutter 的软件渲染器,与 Flutter 默认的硬件加速 OpenGL 渲染器相比,它以降低图形性能为代价来消除这些错误:
$ flutter run --enable-software-rendering
但需要明确的是,这不是 Flutter 错误。这是系统库(libEGL,libgralloc?)在 OnePlus 6(可能还有 Google Pixel 3)上的 Android Pie 上的问题,最终需要设备供应商和/或 Google 进行修复。有some indications安装最新的系统更新可能已经为某些用户解决了这个问题,至少在 2018 年 10 月下旬是这样。
基于 commit声称在谷歌的新 Pixel 3 XL 设备(代号“crosshatch”)上解决了同样的问题,潜在的问题似乎是 Android Pie 本身或供应商对 Android 的定制引入了对 vendor.debug 的新依赖。 egl.swapinterval
构建属性,但此属性访问被安全策略拒绝。解决方法是更改安全策略以允许启动动画和应用程序访问此属性。
vendor.debug.egl.swapinterval
是什么?它控制显示帧速率。引用 eglSwapInterval
的 Khronos Group 文档API,这个区间:
Specifies the minimum number of video frames that are displayed before a buffer swap will occur.
如在 XDA 论坛上粗略搜索显示,modders 已 tweaking这个参数多年来。
关于android - Flutter 调试带有不同消息的垃圾邮件控制台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53026047/