记录一个Flutter加载iOS原生地图View时的错误Shader compilation error
出现场景是自制一个百度地图插件,加载原生mapView时报如下错误崩溃.
Shader compilation error
------------------------
1 #version 300 es
2
3 precision mediump float;
4 out mediump vec4 sk_FragColor;
5 uniform sampler2D uTextureSampler_0_Stage0;
6 in highp vec2 vlocalCoord_Stage0;
7 void main() {
8 mediump vec4 outputColor_Stage0;
9 {
10 outputColor_Stage0 = vec4(1.0);
11 highp vec2 texCoord;
12 texCoord = vlocalCoord_Stage0;
13 outputColor_Stage0 = texture(uTextureSampler_0_Stage0, texCoord);
14 }
15 {
16 sk_FragColor = outputColor_Stage0;
17 }
18 }
19
Errors:
ERROR: 0:1: '' : version '300' is not supported
ERROR: 0:1: '' : syntax error: #version
解决方案是,在实现了FlutterPlatformView
协议的ViewController中,将赋值self.View = _mapView
的操作改为在self.View上面添加_mapView,仍然返回self.View供flutter渲染.
版权属于:邢迪的平行时空
本文链接:https://xingdi.me/archives/49.html
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可