微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 Flutter 2.0.4 上构建 iOS 应用程序错误:找不到“Flutter/Flutter.h”文件

如何解决在 Flutter 2.0.4 上构建 iOS 应用程序错误:找不到“Flutter/Flutter.h”文件

我一直在尝试从 Android Studio 在 iOS 上运行应用程序。我一直收到错误

/Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h:1:9: note: in file included from /Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h:1:
    #import "GeneratedpluginRegistrant.h"
            ^
    /Users/apple/StudioProjects/example-app/ios/Runner/GeneratedpluginRegistrant.h:8:9: error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^
    1 error generated.
    <unkNown>:0: error: Failed to emit precompiled header '/Users/apple/Library/Developer/Xcode/DerivedData/Runner-ggksyvhflvuluxawpqfuznxyoqim/Build/Intermediates.noindex/precompiledHeaders/Runner-Bridging-Header-swift_LWMBPN794CZS-clang_BZEEHKV9P35.pch' for bridging header '/Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h'
    /Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h:1:9: note: in file included from /Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h:1:
    #import "GeneratedpluginRegistrant.h"
            ^
    2 errors generated.
    <unkNown>:0: error: generate-pch command Failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

我已经试过了 Flutter iOS build failed an error of pod files: Podfile is out of date

这是我的颤振医生

[✓] Flutter (Channel stable,2.0.4,on macOS 11.1 20C69 darwin-x64,locale en-GB)
    • Flutter version 2.0.4 at /Users/apple/development/mobile/Flutter
    • Framework revision b1395592de (10 days ago),2021-04-01 14:25:01 -0700
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/apple/Library/Android/sdk
    • Platform android-30,build-tools 30.0.3
    • 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 at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3,Build version 12C33
    • CocoaPods version 1.10.1

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

[✓] Android Studio (version 4.1)
    • 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 1.8.0_242-release-1644-b3-6915495)

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

[✓] Connected device (4 available)
    • iPhone (mobile)            • 34570a362a2df73d484d834ef7354c1be8983665 • ios            • iOS 14.4
    • iPhone 12 Pro Max (mobile) • 0EDA0F75-828C-4663-BF48-CC40B7F6BD66     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    • darwin-x64     • macOS 11.1 20C69 darwin-x64
    • Chrome (web)               • chrome                                   • web-javascript • Google Chrome 89.0.4389.114

• No issues found!
Process finished with exit code 0

这里有什么建议吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。