Repository: flutter
Issue: `GetUsedThisFrame` assertion failure in `Rasterizer::DrawToSurfaceUnsafe`
Labels: c: crash,platform-android,engine,P2,c: fatal crash,team-android,triaged-android

Steps to reproduce:
- Check out flutter/plugins
- Run `packages/webview_flutter/webview_flutter/example/` on Android with a local debug engine

Expected results:
Example launches

Actual results:
Assertion failure on launch
```
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: '[FATAL:flutter/shell/common/rasterizer.cc(498)] Check failed: !external_view_embedder_->GetUsedThisFrame(). '
    x0  0000000000000000  x1  00000000000059f6  x2  0000000000000006  x3  0000007fe54ece00
    x4  737260712e6d6e6c  x5  737260712e6d6e6c  x6  737260712e6d6e6c  x7  7f7f7f7f7f7f7f7f
    x8  00000000000000f0  x9  0000007f5af3aa00  x10 0000000000000001  x11 0000007f5af78ce4
    x12 000000000000d934  x13 000000000000006e  x14 0000007fe54ebcd0  x15 00000000044c6498
    x16 0000007f5afddd60  x17 0000007f5afbab70  x18 0000007f63db4000  x19 00000000000059f6
    x20 00000000000059f6  x21 00000000ffffffff  x22 00000000ffffffff  x23 0000007d604379f0
    x24 0000007d60437ac0  x25 0000007d60437a08  x26 0000007d6044c968  x27 0000000000000000
    x28 00000000ffffffff  x29 0000007fe54ece80
    lr  0000007f5af6a868  sp  0000007fe54ecde0  pc  0000007f5af6a894  pst 0000000000000000
backtrace:
      #00 pc 0000000000051894  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 058e3ec96fa600fb840a6a6956c6b64e)
      #01 pc 0000000001e26c28  .../lib/arm64/libflutter.so (std::_LIBCPP_ABI_NAMESPACE::__throw_bad_optional_access[abi:v15000]()+8) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #02 pc 0000000001eecc10  .../lib/arm64/libflutter.so (fml::LogMessage::~LogMessage()+260) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #03 pc 0000000002c458ec  .../lib/arm64/libflutter.so (flutter::Rasterizer::DrawToSurfaceUnsafe(flutter::FrameTimingsRecorder&, flutter::LayerTree&)+392) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #04 pc 0000000002c43e58  .../lib/arm64/libflutter.so (flutter::Rasterizer::DrawToSurface(flutter::FrameTimingsRecorder&, flutter::LayerTree&)+216) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #05 pc 0000000002c44dcc  .../lib/arm64/libflutter.so (flutter::Rasterizer::DoDraw(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::FrameTimingsRecorder, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::FrameTimingsRecorder> >, std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::LayerTree>)+400) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #06 pc 0000000002c47b9c  .../lib/arm64/libflutter.so (flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2::operator()(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >) const+188) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #07 pc 0000000002c47ac8  .../lib/arm64/libflutter.so (decltype(std::declval<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2&>()(std::declval<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> > >())) std::_LIBCPP_ABI_NAMESPACE::__invoke[abi:v15000]<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2&, std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> > >(flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2&, std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >&&)+52) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #08 pc 0000000002c47a84  .../lib/arm64/libflutter.so (void std::_LIBCPP_ABI_NAMESPACE::__invoke_void_return_wrapper<void, true>::__call<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2&, std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> > >(flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2&, std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >&&)+28) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #09 pc 0000000002c47a58  .../lib/arm64/libflutter.so (std::_LIBCPP_ABI_NAMESPACE::__function::__alloc_func<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2, std::_LIBCPP_ABI_NAMESPACE::allocator<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2>, void (std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >)>::operator()[abi:v15000](std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >&&)+32) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #10 pc 0000000002c47a28  .../lib/arm64/libflutter.so (std::_LIBCPP_ABI_NAMESPACE::__function::__func<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2, std::_LIBCPP_ABI_NAMESPACE::allocator<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_2>, void (std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >)>::operator()(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >&&)+32) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #11 pc 0000000001ef4b9c  .../lib/arm64/libflutter.so (std::_LIBCPP_ABI_NAMESPACE::__function::__value_func<void (fml::TaskSource const*)>::operator()[abi:v15000](fml::TaskSource const*&&) const+72) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #12 pc 0000000002c47d80  .../lib/arm64/libflutter.so (std::_LIBCPP_ABI_NAMESPACE::function<void (std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >)>::operator()(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >) const+20) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #13 pc 0000000002c4452c  .../lib/arm64/libflutter.so (flutter::Pipeline<flutter::LayerTreeItem>::Consume(std::_LIBCPP_ABI_NAMESPACE::function<void (std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >)> const&)+264) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #14 pc 0000000002c44150  .../lib/arm64/libflutter.so (flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)+384) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #15 pc 0000000002c6f190  .../lib/arm64/libflutter.so (flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> >)::$_12::operator()()+132) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #16 pc 0000000002c6f0fc  .../lib/arm64/libflutter.so (auto fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> >)::$_12>::operator()<>() const+28) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #17 pc 0000000002c6f0d0  .../lib/arm64/libflutter.so (decltype(std::declval<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> >)::$_12>&>()()) std::_LIBCPP_ABI_NAMESPACE::__invoke[abi:v15000]<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> >)::$_12>&>(fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> >)::$_12>&)+20) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #18 pc 0000000002c6f0ac  .../lib/arm64/libflutter.so (void std::_LIBCPP_ABI_NAMESPACE::__invoke_void_return_wrapper<void, true>::__call<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> >)::$_12>&>(fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> >)::$_12>&)+20) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
      #19 pc 0000000002c6f088  .../lib/arm64/libflutter.so (std::_LIBCPP_ABI_NAMESPACE::__function::__alloc_func<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> >)::$_12>, std::_LIBCPP_ABI_NAMESPACE::allocator<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> >)::$_12> >, void ()>::operator()[abi:v15000]()+24) (BuildId: e885b5977fbe7860a649eef42968283c5dd76e88)
```

I haven't investigated this at all; I hit it incidentally while trying to debug something unrelated.