gpt4 book ai didi

ios - Flutter.h 未找到错误

转载 作者:IT王子 更新时间:2023-10-29 07:08:46 25 4
gpt4 key购买 nike

从几天前开始,我就失去了为 iOS 构建 Flutter 应用程序的能力。我将我的 iPad 更新到 11.4,这迫使我将 xCode 更新到 9.4,而且我认为 Flutter 的新版本也加入其中。以我无限的智慧,我更新了它们,现在不能再测试我的项目了。

随着截止日期的临近,我正在寻求有关如何重新开始行动的建议。我对 Apple 产品不是很熟悉,所以我还不太了解 xCode 等。

这是一个全新的“FLUTTER CREATE testproject”项目,未对其进行任何更改。

FLUTTER 运行日志:

Launching lib/main.dart on iPad Pro (12.9-inch) (2nd generation) in debug mode...
Starting Xcode build...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:

** BUILD FAILED **

Xcode's output:

=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
cp: /Users/trevburley/FlutterSDK/flutter/bin/cache/artifacts/engine/ios/Flutter.framework: No such file or directory
find: /Users/trevburley/IdeaProjects/testproject/ios/Flutter/Flutter.framework: No such file or directory
Project /Users/trevburley/IdeaProjects/testproject built and packaged successfully.
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
In file included from /Users/trevburley/IdeaProjects/testproject/ios/Runner/GeneratedPluginRegistrant.m:5:
/Users/trevburley/IdeaProjects/testproject/ios/Runner/GeneratedPluginRegistrant.h:8:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the application for the simulator.
Error launching application on iPad Pro (12.9-inch) (2nd generation).

和冗长的 FLUTTER DOCTOR:

Trevs-MBP:testproject trevburley$ flutter doctor -v
[✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.13.5 17F77, locale en-GB)
• Flutter version 0.4.4 at /Users/trevburley/FlutterSDK/flutter
• Framework revision f9bb4289e9 (3 weeks ago), 2018-05-11 21:44:54 -0700
• Engine revision 06afdfe54e
• Dart version 2.0.0-dev.54.0.flutter-46ab040e58

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/trevburley/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.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_152-release-1024-b01)
• All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4, Build version 9F1027a
• ios-deploy 1.9.2
• CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 25.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.1.4)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 25.0.2
• Dart plugin version 181.4892.1

[✓] VS Code (version 1.23.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Dart Code extension version 2.13.0

[✓] Connected devices (1 available)
• iPad Pro (12.9-inch) (2nd generation) • D8D24435-C465-4403-B74F-E8DD32DDD30A • ios • iOS 11.4 (simulator)

• No issues found!

最佳答案

我猜这个问题是由于cocoapods安装中断造成的。这是修复:

  • 从您的项目中删除ios/Flutter/Flutter.framework
  • 在 ios 目录中运行 pod install。应生成 Flutter.framework,包括 Headers/Flutter.h 文件
  • 运行构建。现在一切都应该正常了

虽然切换到不同的 Flutter 可能会奏效,但它并不能真正解决缓存损坏的问题。请记住,Flutter 的 master 和 beta 分支不适合生产发布。

关于ios - Flutter.h 未找到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50671286/

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