Closed alecsam closed 4 years ago
this happens when the app is requesting for any permission in ios, and the flutter NativeView try to render itself. so as long as the permission dialog hanging there, i think it's considered to be "headless".
i think, what you can do to fix this is basically wait until the permission request is finished, and then try to render / call the build NativeView (whatever it is, could be WebView or GoogleMap). For what i know, ios permission request will only prompt only when the service is called (start motion activity update / get current location from GPS / Notification received)
although this case is relatively hard to reproduce, and considered to be rare occasion (need to have ios permission request script [calling the GPS location / Notification received thus will prompt notification permission request / start motion activity update], and render the NativeView at the same time)
On iOS, when I open for the first time the camera I get this error:
PlatformException(create_failed, can't create a view on a headless engine, null)
Complete error:
If I open the camera again, everything works fine.
See also: https://github.com/flutter/flutter/issues/36310