flutter pub get 无法生成 .ios 文件夹解决

1,878 阅读1分钟

要生成 .ios文件夹需要的条件:

  1. 必须要用 pubspec.yaml 文件,否则 flutter pub get 也不能执行
  2. pubspec.yaml 中,以下代码必须存在
  module:
    androidX: true
    androidPackage: com.example.flutter_base_component
    iosBundleIdentifier: com.example.flutterBaseComponent
  1. 最坑人的地方是当前项目文件夹内不能存在与 .ios 几乎同名的文件夹 ios, 如果存在,那么生成的 ios 文件夹中 flutter 下缺少 engine 文件夹。

image.png

image.png

  1. 最容易也是最不容易发现的地方:yaml 文件的特殊性,如果缩进不当,也无法生成文件夹。