Flutter运行时出现D/skia ( 1414): Shader compilation error的解决方法

问题:在模拟器运行时出现这种情况

复制代码
D/skia    ( 1414): Shader compilation error
D/skia    ( 1414): ------------------------
D/skia    ( 1414):    1 #version 100
D/skia    ( 1414):    2
D/skia    ( 1414):    3 #extension GL_OES_EGL_image_external : require
D/skia    ( 1414):    4 precision mediump float;
D/skia    ( 1414):    5 precision mediump sampler2D;
D/skia    ( 1414):    6 precision mediump samplerExternalOES;
D/skia    ( 1414):    7 uniform samplerExternalOES uTextureSampler_0_Stage0;
D/skia    ( 1414):    8 varying highp vec2 vlocalCoord_Stage0;
D/skia    ( 1414):    9 void main() {
D/skia    ( 1414):   10     mediump vec4 outputColor_Stage0;
D/skia    ( 1414):   11     {
D/skia    ( 1414):   12         outputColor_Stage0 = vec4(1.0);
D/skia    ( 1414):   14         texCoord = vlocalCoord_Stage0;
D/skia    ( 1414):   15         outputColor_Stage0 = texture2D(uTextureSampler_0_Stage0, texCoord);        
D/skia    ( 1414):   16     }
D/skia    ( 1414):   17     {
D/skia    ( 1414):   18         gl_FragColor = outputColor_Stage0;
D/skia    ( 1414):   19     }
D/skia    ( 1414):   20 }
D/skia    ( 1414):   21
D/skia    ( 1414): Errors:
D/skia    ( 1414): ERROR: 0:6: 'GL_OES_EGL_image_external' : extension is disabled
D/skia    ( 1414): ERROR: 0:6: 'samplerExternalOES' : unsupported type
D/skia    ( 1414):
复制代码

解决方法:

1:我的解决方法:清空模拟器运行内存,并且清理磁盘,把极速渲染模式(DirectX)更换为兼容模式(OpenGL)。

2:其他方法:

1)运行 flutter clean再运行flutter run

2)运行flutter run --enable-software-rendering

 

这种情况出现的话大概率是模拟器内存问题,清理内存就好了,flutter clean不行的话就手动清理。

欢迎讨论!

posted @   漫游者杰特  阅读(2021)  评论(1编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
· 为什么 退出登录 或 修改密码 无法使 token 失效
点击右上角即可分享
微信分享提示