【问题标题】:Module not found issue with package installed in flutter module (add-to-app)安装在颤振模块中的软件包未找到模块问题(添加到应用程序)
【发布时间】:2020-08-20 05:04:58
【问题描述】:

我已将颤振模块添加到现有的 iOS 应用程序中。在编译时,iOS 应用程序无法找到安装的所有包(通过 pubspec.yaml 文件),但我在 XCode 中出现“找不到模块”错误。到目前为止,这些有问题的包是:razorpay_flutter、google_maps_flutter、webview_flutter 和 url_launcher。请看下面的截图:

其他 3 个包也是如此。

重现问题的步骤:

  1. 在 pubspec.yaml 文件中添加razorpay_flutter: ^1.1.3 颤振模块
  2. 运行flutter pub get。该软件包将安装
  3. 运行添加了flutter模块的Xcode项目。出错了!

我在第 2 步之后观察到的另一件事是,有一些关于添加到现有应用程序的问题的警告:

Running "flutter pub get" in lib_smazing...                         
The plugin `razorpay_flutter` is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment. 
It may have undefined behaviors when Flutter is integrated into an existing app as a module.
The plugin can be updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.

我猜在添加到现有应用程序时使用平台通道/代码的包存在问题,但不确定是特定于包的问题还是添加到应用程序的颤振问题。

【问题讨论】:

    标签: ios flutter flutter-add-to-app


    【解决方案1】:

    经过几次尝试和错误后,我发现只需在 iOS 项目目录上运行 pod install 即可解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-06
      • 2021-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-10
      • 1970-01-01
      • 2018-06-16
      相关资源
      最近更新 更多