Flutter 出现异常 进行过Flutter版本切换后编译工程报错iOS 报错 'Flutter/Flutter.h' file not found

出现问题

Flutter 控制台报错

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Exited (sigterm)

iOS Xcode 报错
'Flutter/Flutter.h' file not found

解决方案

方案一:

  1. 首先检查Flutter版本是否和工程所需版本对应
    终端输入flutter doctor
ming@MingdeMBP ~ % flutter doctor           
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 1.22.4, on macOS 11.3 20E5231a darwin-x64, locale
    zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.55.2)
[!] Connected device
    ! No devices available
  1. 删除Podfile.lock 重新 pod install
    路径:.../ios/Podfile.lock
    项目路径下终端输入pod install
    3.若未解决查看自己的Pod版本是否有过升级,因Flutter各个版本所支持的Pod版本不尽相同,需要对应到你所使用的Flutter 版本所支持的Pod版本,可对Pod 版本进行降级。

你可能感兴趣的:(Flutter 出现异常 进行过Flutter版本切换后编译工程报错iOS 报错 'Flutter/Flutter.h' file not found)