出现场景是自制一个百度地图插件,加载原生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渲染.

标签: flutter, 百度地图, baidu, Shader compilation error, ERROR: 0:1: '' : version '300' is not supported

添加新评论