【问题标题】:fatal error: 'Flutter/Flutter.h' file not found for Flutter 2.2.3致命错误:未找到 Flutter 2.2.3 的“Flutter/Flutter.h”文件
【发布时间】:2021-09-29 11:25:33
【问题描述】:

自从我升级到 Flutter 2.2.3 后,我就一直遇到这个问题

致命错误:找不到“Flutter/Flutter.h”文件 #import "Flutter/Flutter.h"

两个插件

  1. 共享首选项
  2. URLLauncher

我的 pod 文件的后安装是

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end

但是,当我将其更改为

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end

它给出了以下错误

iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但支持的部署目标版本范围为 9.0 到 14.5.99。

颤振医生 -v 输出

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5 20G71 darwin-x64, locale en-IN)
    • Flutter version 2.2.3 at /Users/ritikadesai/flutter
    • Framework revision f4abaa0735 (3 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/ritikadesai/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 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

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

[✓] Android Studio (version 4.2)
    • 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 11.0.8+10-b944.6916264)

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

[✓] Connected device (2 available)
    • iPhone 12 Pro (mobile) • 2173457A-60B4-46EB-9EB0-B1AC72A84782 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 91.0.4472.114

• No issues found!

我已经尝试了所有方法,包括删除 Podfile、Podfile.lock、Pods 文件夹、升级 Flutter、将频道从 Stable 更改为 Master 到 Beta、创建新项目和复制 iOS 文件夹

没有任何效果,我已经被困了好几天了。

感谢任何帮助

谢谢!

【问题讨论】:

    标签: flutter ios-simulator


    【解决方案1】:

    我尝试了很多解决方案,但只有一个对我有用。

    1. rm -rf ios
    2. flutter create .
    3. flutter pub get

    我会在iOS和其他一些东西上丢失应用程序图标,但如果你使用git,可以轻松恢复你需要的文件。

    【讨论】:

      猜你喜欢
      • 2021-09-04
      • 2021-11-18
      • 2021-07-21
      • 2021-03-26
      • 2021-11-20
      • 1970-01-01
      • 1970-01-01
      • 2021-05-19
      • 2021-09-01
      相关资源
      最近更新 更多