flutter - Flutter 构建失败并出现致命错误:找不到“Flutter/Flutter.h”文件
问题描述
我正在用颤振开发应用程序,
我收到致命错误:'Flutter/Flutter.h' file not found ,当我构建我的应用程序时出现此错误。
我尝试重新安装 cocoapod 并删除 podfile.lock 并重新安装它,
但我仍然收到此错误..
我该怎么办这个错误?
daegilpyo@DAEGILs-MacBook-Pro eminail % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B50 darwin-x64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
[✓] Android Studio (version 3.6)
[✓] Connected device (1 available)
• No issues found!
daegilpyo@DAEGILs-MacBook-Pro eminail %
vent sent after app closed: {id: 0, progressId: null, finished: true}
Launching lib/main.dart on DAEGIL의 iPhone in debug mode...
lib/main.dart:1
Automatically signing iOS for device deployment using specified development team in Xcode project: T6ULPGT4J7
Xcode build done. 18.9s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Command CompileSwift failed with a nonzero exit code
In file included from /Users/daegilpyo/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.m:7:
/Users/daegilpyo/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
解决方案
转到终端,备份您的 ios/Runner 文件夹并删除您的 ios 文件夹。然后去终端执行
cd path/to/your/project/projectName
flutter create .
flutter run
如果颤动运行失败
cd ios
pod install
cd ..
flutter run
推荐阅读
- apache-kafka - 使用 Logstash 的 Kafka 输出插件编写 Kafka 消息头
- android - 收到 SMS_RECEIVED 后访问 SMS 内容提供商在 Android 中好吗?
- macos - 如何将 Rust 应用程序从 macOS x86 交叉编译到 macOS Silicon?
- javascript - 当我使用 PrivateRoute 时,我总是在重新加载页面时进入一次登录页面
- angularjs - 使用 stateProvider 进行路由时,如何在 AngularJS SPA 上获取 URL 参数
- node.js - npm serial-port 获取输出以响应组件
- python - 设置蟒蛇
- spring-boot - Spring Boot SecurityContextHolder.getContext().getAuthentication() 在基本身份验证上返回 null
- apache - 如何将 HTACCESS 更改重定向到现在允许子目录 URL?
- javascript - 在 mongodb 中存储/更新深度嵌套的对象数组