Flutter 颤振webview\u颤振构建失败

Flutter 颤振webview\u颤振构建失败,flutter,webview,Flutter,Webview,我正在尝试安装webview_颤振插件,但不知何故,我的构建每次都失败了 Launching lib/main.dart on iPhone 11 Pro in debug mode... Running Xcode build... ├─Assembling Flutter resources... 10.2s └─Compiling, linking and signing... 2.1

我正在尝试安装webview_颤振插件,但不知何故,我的构建每次都失败了

Launching lib/main.dart on iPhone 11 Pro in debug mode...

Running Xcode build...

 ├─Assembling Flutter resources...                          10.2s
 └─Compiling, linking and signing...                         2.1s
Xcode build done.
17.5s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    <path_to_project>ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal
    error: module 'webview_flutter' not found
    @import webview_flutter;
     ~~~~~~~^~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.
我试着跑步,但没有解决问题

flatter clean


flatter pub cache repair

您是否了解该插件的所有iOS安装

这来自页面本身:

要在iOS上使用此插件,您需要选择嵌入视图 通过向应用程序的Info.plist文件添加布尔属性进行预览, 使用io.FLATTER.embedded_views_preview键和值YES


这似乎也有关系,看看:

在我的例子中,问题是我手动编辑了pod文件,将我自己的(非颤振)pod添加到项目中。但是,flatter构建不会试图编辑(或覆盖)podfile(也许这是好的),因此podfile不会有支持webview\u flatter所需的更改。我通过创建一个全新的Flatter项目,并将新项目生成的podfile与当前版本进行比较,解决了这一问题。他们看起来大不相同。

我跟着看。如果查看错误,这与构建xocde输出有关。
dependencies:
  flutter:
    sdk: flutter

  webview_flutter: ^0.3.19+8