ios - 词法或预处理器问题 (Xcode) : 'Flutter/Flutter.h' file not found

标签 ios xcode flutter dart debugging

我正在处理一个团队的项目,当我尝试调试时遇到此错误。

我的 flutter doctor 没有发现任何问题,而且我不熟悉代码,因为我从别人那里得到了项目 repo。

Launching lib/main.dart on iPhone 13 in debug mode...
lib/main.dart:1
Xcode build done.                                            1.8s
Failed to build iOS app
Error output from Xcode build:
↳
    objc[52692]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x21604eb90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1079642c8). One of the two will be used. Which one is undefined.
    objc[52692]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x21604ebe0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x107964318). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **
Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/v_/6mfr50g51js_jftp_690pynr0000gn/T/flutter_tools.JycZbC/flutter_ios_build_temp_dirAePF6Z/temporary_xcresult_bundle
In file included from /Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.m:5:
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/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/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.m:5:
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
    Result bundle written to path:
        /var/folders/v_/6mfr50g51js_jftp_690pynr0000gn/T/flutter_tools.JycZbC/flutter_ios_build_temp_dirAePF6Z/temporary_xcresult_bundle
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.h:4:8
2

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.h:4:8
2

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

编辑:
在我删除派生数据并尝试:flutter clean > flutter pub get > cd ios > pod install > pod update 并再次尝试构建应用程序,我遇到了同样的错误。

最佳答案

我自己遇到了这个问题,所有 SO 答案似乎都指向清理、pod 安装、...正确答案深埋在 Flutter 中

但是,这是由目标运行器的 Xcode 项目构建阶段内的“运行脚本”上的复选框“仅用于安装构建”引起的。这需要取消选择

https://github.com/flutter/flutter/issues/99387#issuecomment-1081238267

Checkbox on Run Script

关于ios - 词法或预处理器问题 (Xcode) : 'Flutter/Flutter.h' file not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72103187/

相关文章:

ios - 为首次使用应用程序制作 View

xcode - 为什么我无法在 Storyboard中转换到我的 View Controller 子类?

swift - 窗口不透明?

android - 刚刚发布的应用程序,未与 Google AdMob 关联

ios - SwiftyJSON - 解析时如何循环子节点

android - Android 上的 Gmail/iOS 上的默认邮件应用缩小文本

iOS - 更改 REALM 对象属性时应用程序崩溃

xcode - 无法将 Apple TV 与 Xcode 配对

Flutter:如何在聊天消息中制作电报式气泡

android - 在 Flutter 中将图像转换为 XFile