skip to Main Content

I have Mac and use Android studio and Xcode, I got the following error messages when I tried to run my Flutter app or when I tried to do Build -> Build iOS
I tried most solution I found in web like: pod install or remove pods files,,, and another solutions but did not helped me, How to fix? thanks

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

And Flutter doctor here:

/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

Flutter -v

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.

2

Answers


  1. Here is some steps you can follow :-

    cd.. your flutter project
    run flutter clean

    run your project iOS directory in Xcode

    go to preferences-> Location and clear derive data

    derive data

    then run cd.. your_project_path/iOS in your terminal

    then run pod install

    then run your code in simulator using Xcode

    Maybe it can solve your problem

    Login or Signup to reply.
  2. Upgrade the Project dependencies to latest versions by running command

    flutter pub upgrade
    

    Go to iOS folder of the project run

    pod init
    

    and

    pod install
    

    I hope this solution solve your problem.

    Please up the vote if this answer help you.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search