Flutter 1.9: D/skia ( 5106): Shader compilation error

46,730

Solution 1

I solved my Shader compilation error by changing emulator's settings.

Press that ... button which is located on the side panel of emulator, and go to Settings section. There, go to Advanced tab and change OpenGL ES API level to Compatibility (OpenGL ES 1.1/2.0).

Do not forget to close and rerun the emulator after this change. On the first run, emulator could pop a warning on its screen and it would take a while to get ready, but do not worry.

Solution 2

The error message comes from: Add ShaderErrorHandler to GrContextOptions

In the previous Flutter versions, the persistent cache had been disabled to remedy the problem. However, it is currently enabled in the Fllutter engine: Revert "Disable the persistent cache

Possible solutions:

  • Downgrade your Flutter version to the linked commit
  • Enable rendering flutter run --enable-software-rendering
  • Disable hardware acceleration in the emulator

Issue:

8578 Shader compilation error

Solution 3

Open the terminal, Navigate to your folder and

Type flutter run --enable-software-rendering after that debug and run again.

This worked for me and it might help you too!

Solution 4

I was facing the same issue.Use flutter clean and then run the app. This fixed mine.

Solution 5

I had the same problem, once I wrapped the widget in Scaffold , the problem is solved.

Share:
46,730
MDIT
Author by

MDIT

Java and Oracle forms 10g developer.

Updated on July 09, 2022

Comments

  • MDIT
    MDIT almost 2 years

    I've created a simple Flutter 1.9.1+hotfix.4 application using Android Studio 3.5.1. After adding successfully a new virtual device (Nexus 6) and tried to run my app, I got this error:

    Launching lib\main.dart on Android SDK built for x86 in debug mode...
    Initializing gradle...
    Resolving dependencies...
    Running Gradle task 'assembleDebug'...
    Built build\app\outputs\apk\debug\app-debug.apk.
    Syncing files to device Android SDK built for x86...
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/EGL_emulation( 5106): eglMakeCurrent: 0xec5ed840: ver 3 1 (tinfo 0xec593810)
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    D/skia    ( 5106): Shader compilation error
    D/skia    ( 5106): ------------------------
    D/skia    ( 5106): Errors:
    D/skia    ( 5106): 
    

    The application runs correctly but the console shows the errors above.

    My Configuration:

    Android Studio 3.5.1

    Build #AI-191.8026.42.35.5900203, built on September 25, 2019

    JRE: 1.8.0_202-release-1483-b03 amd64

    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

    Windows 10 Pro 64bits

  • Raj
    Raj over 4 years
    I wrapped it with Scaffold
  • noobar
    noobar over 4 years
    I added --enable-software-rendering to [Edit Configurations...] > [Additional arguments] and it fixed. Flutter v1.12
  • Secret Squirrel
    Secret Squirrel about 4 years
    What specifically about the emulator caused the issue? Why would running the app "on a real device" fix it? Can you add any insight into this solution?
  • Mustafa Karim
    Mustafa Karim about 4 years
    I just tested it, and i don't know reason why -_-
  • Ian Smith
    Ian Smith over 3 years
    This is not a helpful answer, running it on a real device does not fix the issue on the emulator.
  • Raj Kanchan
    Raj Kanchan about 3 years
    This is a temporary solution, if you use this option, you have to hot reload again and again. Sorry rangerboyy...
  • bluenote10
    bluenote10 almost 3 years
    @TheTahaan Downgrading and avoiding hardware acceleration isn't a very sustainable solution. The root cause of the issue has been fixed in the meantime. In my case, a flutter clean did the trick (which may have been necessary because my emulator had crashed before).
  • mysti9uemirage
    mysti9uemirage over 2 years
    Android Studio > Run > Edit Configurations > Additional run args: --enable-software-rendering
  • Rambod
    Rambod over 2 years
    in my case , this fix my problem.
  • Duck Dodgers
    Duck Dodgers about 2 years
    This should be accepted as the answer. Thank you so much
  • Jammo
    Jammo almost 2 years
    This is the proper solution