在 iOS 模拟器中运行 Flutter 应用时出错:找不到“Flutter/Flutter.h”文件

Error when running Flutter app in iOS simulator: 'Flutter/Flutter.h' file not found

提问人:Bryła - 提问时间:11/15/2023 最后编辑:MarsroverrBryła - 更新时间:11/16/2023 访问量:22

问:

将 Flutter 更新到 3.13.9 后,我无法在 iOS 模拟器上运行我的 Flutter 项目。我尝试卸载 pod/Flutter.sth 等,但没有成功。

以下是启动模拟器时的错误:

Launching lib/main.dart on iPhone 15 Pro in debug mode...
Running pod install...                                             27,5s
Running Xcode build...                                                  
Xcode build done.                                           40,3s
Failed to build iOS app
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/mac/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.0/ios/Classes/messages.g.m:7:8


Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.

以下是 Flutter doctor 的输出:


[✓] Flutter (Channel stable, 3.13.9, on macOS 14.0 23A344 darwin-x64, locale pl-PL)
    • Flutter version 3.13.9 on channel stable at /Users/mac/FlutterDev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d211f42860 (3 weeks ago), 2023-10-25 13:42:25 -0700
    • Engine revision 0545f8705d
    • Dart version 3.1.5
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/mac/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

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

[✓] Connected device (4 available)
    • iPhone (mobile)        • 00008030-001A2CE91A40802E            • ios            • iOS 17.0.3 21A360
    • iPhone 15 Pro (mobile) • 976ED5DE-8480-4931-B658-66C95D80B247 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64     • macOS 14.0 23A344 darwin-x64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 119.0.6045.123

[✓] Network resources
    • All expected network resources are available.

• No issues found! 

这个错误是在更新 Flutter 后才开始出现的。

ios xcode flutter-update

评论


答: 暂无答案