平台异常错误不会在 flutter 中捕获错误

Platform exception error doesn't catch error in flutter

我正在开发一个带有 Google admobs 奖励视频广告的 flutter 应用。我所做的是在应用程序启动时,即在 init 函数中我加载了视频,并且广告将在按钮操作后显示。广告播放完毕后,如果用户再次点击按钮,则 Platform exception error。我还使用了 try catch 语句,但错误仍未被它们捕获。导致的错误在这里。

Exception has occurred.
PlatformException (PlatformException(ad_not_loaded, show failed for rewarded video, no ad was loaded, null))

如何解决这个错误?

这是VS Code的已知bug,取消勾选即可'Uncaught Exceptions'