Flutter打包报错fatal error: 'Flutter/Flutter.h' file not found

用了一个库webview_flutter: ^1.0.7
打包的是时候报错,找不到Flutter/Flutter.h

fatal error: 'Flutter/Flutter.h' file not found

打开ios/Flutter
查看里面是否有生成Flutter.framework
右键Flutter.framework 显示包内容
发现里面没有Headers目录,感觉是这个Flutter.framework损坏了

解决方法:
找个这个目录里面的Flutter.framework


image.png

复制到 项目根目录/ios/Flutter/Flutter.framework

重新打包,成功解决问题

或者另一种解决方案:
删除 项目根目录/ios/Flutter/Flutter.framework
执行命令

flutter clean
flutter pub get
cd ios
pod install

这样就会重新生成Flutter.framework

你可能感兴趣的:(Flutter打包报错fatal error: 'Flutter/Flutter.h' file not found)