首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >未找到颤振Xcode‘iOS /Flutter.h’文件

未找到颤振Xcode‘iOS /Flutter.h’文件
EN

Stack Overflow用户
提问于 2022-02-15 07:19:33
回答 2查看 938关注 0票数 0

我有Mac并使用Android和Xcode,当我试图运行我的应用程序时,或者当我尝试构建-> Build iOS时,我尝试了我在web上找到的大多数解决方案,比如: pods或删除pods文件,以及其他解决方案,但没有帮助我,如何修复?谢谢

代码语言:javascript
运行
复制
Could not build the precompiled application for the device.
Error (Xcode): 'Flutter/Flutter.h' file not found
/Users/test/StudioProjects/app/ios/Runner/GeneratedPluginRegistrant.h:9:8

Error (Xcode): failed to emit precompiled header '/Users/test/Library/Developer/Xcode/DerivedData/Runner-dmjvwbvrfekhkvanzgfshfxgayly/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_3KZJBW1LQ4BLG-clang_3S6LL1PRJK0WS.pch' for bridging header '/Users/test/StudioProjects/app/ios/Runner/Runner-Bridging-Header.h'


Error launching application

颤栗的医生:

代码语言:javascript
运行
复制
/Users/test/Downloads/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.10.1, on macOS 12.2.1 21D62 darwin-x64, locale sv-SE)
    • Flutter version 2.10.1 at /Users/test/Downloads/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db747aa133 (5 days ago), 2022-02-09 13:57:35 -0600
    • Engine revision ab46186b24
    • Dart version 2.16.1
    • DevTools version 2.9.2

[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/test/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2021.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 11.0.11+0-b60-7590822)

[!] Connected device
    ! No devices available

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.
Process finished with exit code 0

颤振-v

代码语言:javascript
运行
复制
Manage your Flutter app development.

Common commands:

  flutter create <output directory>
    Create a new Flutter project in the specified directory.

  flutter run [options]
    Run your Flutter application on an attached device or in an emulator.

Usage: flutter <command> [arguments]

Global options:
-h, --help                      Print this usage information.
-v, --verbose                   Noisy logging, including all shell commands executed.
                                If used with "--help", shows hidden options. If used with "flutter doctor", shows additional diagnostic information. (Use "-vv" to force
                                verbose logging in those cases.)
    --prefixed-errors           Causes lines sent to stderr to be prefixed with "ERROR:".
    --quiet                     Reduce the amount of output from some commands.
    --[no-]wrap                 Toggles output word wrapping, regardless of whether or not the output is a terminal.
                                (defaults to on)
    --wrap-column               Sets the output wrap column. If not set, uses the width of the terminal. No wrapping occurs if not writing to a terminal. Use "--no-wrap" to
                                turn off wrapping when connected to a terminal.
-d, --device-id                 Target device id or name (prefixes allowed).
    --version                   Reports the version of this tool.
    --machine                   When used with the "--version" flag, outputs the information using JSON.
    --[no-]color                Whether to use terminal colors (requires support for ANSI escape sequences).
                                (defaults to on)
    --[no-]version-check        Allow Flutter to check for updates when this command runs.
                                (defaults to on)
    --suppress-analytics        Suppress analytics reporting when this command runs.
    --packages                  Path to your "package_config.json" file.

Local build selection options (not normally required):
    --local-engine-src-path     Path to your engine src directory, if you are building Flutter locally.
                                Defaults to $FLUTTER_ENGINE if set, otherwise defaults to the path given in your pubspec.yaml dependency_overrides for sky_engine, if any.
    --local-engine              Name of a build output within the engine out directory, if you are building Flutter locally.
                                Use this to select a specific version of the engine if you have built multiple engine targets.
                                This path is relative to "--local-engine-src-path" or "--local-engine-src-out" (q.v.).

Options for testing the "flutter" tool itself:
    --show-test-device          List the special "flutter-tester" device in device listings. This headless device is used to test Flutter tooling.
    --show-web-server-device    List the special "web-server" device in device listings.

Available commands:

Flutter SDK
  bash-completion   Output command line shell completion setup scripts.
  channel           List or switch Flutter channels.
  config            Configure Flutter settings.
  doctor            Show information about the installed tooling.
  downgrade         Downgrade Flutter to the last active version for the current channel.
  precache          Populate the Flutter tool's cache of binary artifacts.
  upgrade           Upgrade your copy of Flutter.

Project
  analyze           Analyze the project's Dart code.
  assemble          Assemble and build Flutter resources.
  build             Build an executable app or install bundle.
  clean             Delete the build/ and .dart_tool/ directories.
  create            Create a new Flutter project.
  drive             Run integration tests for the project on an attached device or emulator.
  format            Format one or more Dart files.
  gen-l10n          Generate localizations for the current project.
  pub               Commands for managing Flutter packages.
  run               Run your Flutter app on an attached device.
  test              Run Flutter unit tests for the current project.

Tools & Devices
  attach            Attach to a running app.
  custom-devices    List, reset, add and delete custom devices.
  daemon            Run a persistent, JSON-RPC based server to communicate with devices.
  debug-adapter     Run a Debug Adapter Protocol (DAP) server to communicate with the Flutter tool.
  devices           List all connected devices.
  emulators         List, launch and create emulators.
  install           Install a Flutter app on an attached device.
  logs              Show log output for running Flutter apps.
  screenshot        Take a screenshot from a connected device.
  symbolize         Symbolize a stack trace from an AOT-compiled Flutter app.

Run "flutter help <command>" for more information about a command.
Run "flutter help -v" for verbose help output, including less commonly used options.
EN

回答 2

Stack Overflow用户

发布于 2022-02-15 08:44:56

以下是一些你可以遵循的步骤:-

cd..。您的颤振项目运行flutter clean

在iOS中运行项目Xcode目录

转到preferences-> Location并清除派生数据

然后运行cd..。在您的终端中您的项目路径/iOS

然后运行pod install

然后使用Xcode在模拟器中运行代码。

也许它能解决你的问题

票数 0
EN

Stack Overflow用户

发布于 2022-02-15 09:21:55

通过运行命令将项目依赖项升级到最新版本

代码语言:javascript
运行
复制
flutter pub upgrade

转到项目运行的iOS文件夹

代码语言:javascript
运行
复制
pod init

代码语言:javascript
运行
复制
pod install

我希望这个解决办法能解决你的问题。

如果这个答案对你有帮助,请加大投票。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71122444

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档