错误:在iOS上运行颤动时找不到颤动/颤动.h'文件

本教程将介绍错误:在iOS上运行颤动时找不到颤动/颤动.h'文件的处理方法,这篇教程是从别的地方看到的,然后加了一些国外程序员的疑问与解答,希望能对你有所帮助,好了,下面开始学习吧。

错误:在iOS上运行颤动时找不到颤动/颤动.h'文件 教程 第1张

问题描述

我不知道为什么,但我不能在我的新Macbook上构建或运行这款应用程序,我在另一台Mac或我的Windows电脑上运行相同的文件夹,运行得很好。
在这里,当我干净地运行FIFTH时,我必须运行pub get来解决问题,这正常吗?

如果我创建一个新项目,我可以正常运行颤动运行,所以我认为
我想可能和插件有关。

你知道我怎么才能解决这个问题吗?谢谢

Flutter Doctor
[✓] Flutter (Channel master, 1.24.0-8.0.pre.343, on macOS 11.0.1 20B29 darwin-x64, locale es-419)
 • Flutter version 1.24.0-8.0.pre.343 at /Users/leo/tools/flutter
 • Framework revision cf6c33e58a (2 days ago), 2020-11-21 14:04:01 -0800
 • Engine revision 23a8e027db
 • Dart version 2.12.0 (build 2.12.0-62.0.dev)

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

[✓] 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)

[✓] Connected device (2 available)
 • sdk gphone x86 arm (mobile) • emulator-5554• android-x86 • Android 11 (API
30) (emulator)
 • iPhone 12 Pro Max (mobile)  • F768139D-7B87-4D9E-93B8-14C7D63786B0 • ios•
com.apple.CoreSimulator.SimRuntime.iOS-14-2 (simulator)

• No issues found!




Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...Xcode build done. 11.4s
Failed to build iOS app
Error output from Xcode build:
↳
 ** BUILD FAILED **


Xcode's output:
↳
 <module-includes>:1:9: note: in file included from <module-includes>:1:
 #import "Headers/vibration-umbrella.h"
^
 /Users/leo/Apps/previate_esta/ios/Pods/Target Support Files/vibration/vibration-umbrella.h:13:9: note:
 in file included from /Users/leo/Apps/previate_esta/ios/Pods/Target Support
 Files/vibration/vibration-umbrella.h:13:
 #import "VibrationPlugin.h"
^
 /Users/leo/.pub-cache/hosted/pub.dartlang.org/vibration-1.4.0/ios/Classes/VibrationPlugin.h:1:9: error:
 'Flutter/Flutter.h' file not found
 #import <Flutter/Flutter.h>
^
 <unknown>:0: error: could not build Objective-C module 'vibration'
 In file included from
 /Users/leo/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.3/ios/Classes/FLTURLLauncherPlugin.m:7:
 /Users/leo/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.3/ios/Classes/FLTURLLauncherPlugin.h:5:9
 : fatal error: 'Flutter/Flutter.h' file not found
 #import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
 1 error generated.
 In file included from
 /Users/leo/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.10/ios/Classes/FLTSharedPreference
 sPlugin.m:5:
 /Users/leo/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.10/ios/Classes/FLTSharedPreference
 sPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
 #import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
 1 error generated.
 In file included from
 /Users/leo/.pub-cache/hosted/pub.dartlang.org/share-0.6.5/ios/Classes/FLTSharePlugin.m:5:
 /Users/leo/.pub-cache/hosted/pub.dartlang.org/share-0.6.5/ios/Classes/FLTSharePlugin.h:5:9: fatal
 error: 'Flutter/Flutter.h' file not found
 #import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
 1 error generated.
 In file included from
 /Users/leo/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+4/ios/Classes/FLTSensorsPlugin.m:5:
 /Users/leo/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+4/ios/Classes/FLTSensorsPlugin.h:5:9: fatal
 error: 'Flutter/Flutter.h' file not found
 #import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
 1 error generated.
 note: Using new build system
 note: Building targets in parallel
 note: Planning build
 note: Constructing build description

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

推荐答案

我找到了解决方案!

    备份ios/Runner文件夹。

    删除ios文件夹。

    运行flutter create (your project name)。在项目所在的前一个文件夹中(cd users/user/"projects_folder")
    (这将重新创建ios文件夹)。

    将Runner备份粘贴到ios文件夹中(粘贴到项目中)。

    打开Runner.xcworkspace(到ios文件夹),在那里,检查版本、捆绑ID和所有信息。

    (如果您有Firebase,则必须将GoogleService-Info.Plist再次复制并粘贴到Runner文件夹中(始终通过Xcode)(如果您手动执行此操作,则不起作用)。

最后,flutter run,应该可以工作了!

如果flutter run失败:

    cd ios

    pod install

    cd ..

    flutter run

好了关于错误:在iOS上运行颤动时找不到颤动/颤动.h&#39;文件的教程就到这里就结束了,希望趣模板源码网找到的这篇技术文章能帮助到大家,更多技术教程可以在站内搜索。