gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 13:30:08 29 4
gpt4 key购买 nike

当我在 mac book pro 中编译我的项目时,显示此错误:

Xcode's output:

In file included from /Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/JavaScriptChannelHandler.m:5:
/Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/JavaScriptChannelHandler.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.5.12+4/ios/Classes/FLTSharedPreferencesPlugin.m:5:
/Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.5.12+4/ios/Classes/FLTSharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/FlutterWebView.m:5:
/Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/FlutterWebView.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/FLTWebViewFlutterPlugin.m:5:
/Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/FLTWebViewFlutterPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/FLTWKNavigationDelegate.m:5:
/Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/FLTWKNavigationDelegate.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/FLTCookieManager.m:5:
/Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24/ios/Classes/FLTCookieManager.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/wakelock-0.1.4+2/ios/Classes/WakelockPlugin.m:1:
/Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/wakelock-0.1.4+2/ios/Classes/WakelockPlugin.h:1:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
/Users/dolphin/.pub-cache/hosted/pub.flutter-io.cn/video_player-0.10.12+5/ios/Classes/messages.m:4:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
我尝试通过这种方式修复它:
~/apps/flutter/bin/flutter clean
没有用,然后我尝试了这种方式:
$ pod install
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229: warning: Insecure world writable dir /Users/dolphin in PATH, mode 040777
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 15 dependencies from the Podfile and 18 total pods installed.

[!] A license was specified in podspec `sentry_flutter` but the file does not exist - /Users/dolphin/Documents/GitHub/cruise-open/ios/.symlinks/plugins/LICENSE

[!] Unable to read the license file `../../LICENSE` for the spec `sentry_flutter (0.0.1)`

[!] Unable to read the license file `../../LICENSE` for the spec `sentry_flutter (0.0.1)`

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
(base)
仍然不起作用,为什么会发生这种情况,我该怎么办?这是我的 channel :
$ ~/apps/flutter/bin/flutter doctor -v
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.7 19H114, locale en-CN)
• Flutter version 1.20.4 at /Users/dolphin/apps/flutter
• Framework revision fba99f6cf9 (4 months ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/dolphin/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[!] IntelliJ IDEA Community Edition (version 2020.3.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins

[!] IntelliJ IDEA Ultimate Edition (version 2019.2.2)
• IntelliJ at /Users/dolphin/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1

[✓] Connected device (1 available)
• iPhone 11 Pro (mobile) • 4FEAF225-103D-4237-96D7-026059D2BDB4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-7
(simulator)

! Doctor found issues in 3 categories.
(base)

最佳答案

由于您拥有较旧版本的 flutter(9 月发布),我建议您将 flutter 升级到最新的稳定版本 1.22.5。只需输入终端

flutter upgrade
如果这没有帮助,请删除 ios 文件夹,然后输入项目的根目录
flutter create .
重新创建 ios 文件夹并再次尝试构建。

关于flutter - fatal error : 'Flutter/Flutter.h' file not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65749992/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com