Flutter debugging spams console with different messages

1,817

Solution 1

The workaround is to use Flutter's software renderer, which silences these errors at the cost of reduced graphics performance as compared to Flutter's default hardware-accelerated OpenGL renderer:

$ flutter run --enable-software-rendering

To be clear, though, this isn't a Flutter bug. It's an issue with the system libraries (libEGL, libgralloc?) on Android Pie on OnePlus 6 (and perhaps the Google Pixel 3), and ultimately needs a fix by the device vendor and/or Google. There are some indications that installing the latest system updates might have fixed this issue for some users, at least, as of late October 2018.

Based on a commit that purports to fix the same issue on Google's new Pixel 3 XL device (codename "crosshatch"), the underlying problem appears to be that either Android Pie itself or vendor customizations to Android introduced a new dependency on the vendor.debug.egl.swapinterval build property, but this property access was denied by security policy. The fix is to change the security policy to permit the boot animation and apps access to this property.

And what is vendor.debug.egl.swapinterval? It controls the display frame rate. Quoting the Khronos Group documentation for the eglSwapInterval API, this interval:

Specifies the minimum number of video frames that are displayed before a buffer swap will occur.

As a cursory search on the XDA Forums shows, modders have been tweaking this parameter for years.

Solution 2

If this happens to you now (March 2019) with OnePlus device (possibly even other devices) after the Flutter 1.2.1 upgrade, you can either use the "--enable-software-rendering" workaround as stated in accepted answer by Arto Bendiken or this one:

Look into your build.gradle file located in your project folder ($PROJECT_FOLDER/android/app/) and look at compileSdkVersion and targetSdkVersion. If those numbers are set to 28, lower them to 27 (or lower, if you want / need to). Flutter 1.2.1 generates projects with those variables set to 28 (Android 9 Pie).

Explanation:
Some users stated that upgrading to newer versions of the ROM fixed the issue for them. I use this device:

Device: OnePlus 6T (ONEPLUS A6013)
Build: A6013_41_190123
OxygenOS: 9.0.12

Someone wrote that it was fixed for him in version 9.0.3, which is older than my 9.0.12.

The thing is that I used this device with Flutter 1.0.0 without any problem and after Flutter 1.2.1 upgrade (and new project generation) this started to happen. Older projects still worked without this issue, so I checked some files for differences and found out that build.gradle differs. In other words Flutter 1.2.1 is targetting Android 9 Pie by default. It is still probably related to OnePlus tho, because I tried running the app on some Moto G phone with Android 8 and the issue was not present there. (Even with compile/targetSdkVersion set to 28).

Share:
1,817
Isak
Author by

Isak

Updated on December 07, 2022

Comments

  • Isak
    Isak over 1 year

    I'm getting a lot of weird messages when debugging my flutter app on my OnePlus 6. The messages appear when I click on buttons, swipe and so on. I'm on Android Pie.

    Some of the messages:

    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 
    

    How do I get rid of them, the app seems to work fine. It's hard to read print() messages with all this clutter.