error: 'Flutter/Flutter.h' file not found when running ios build
Asked Answered
A

2

11

I've seen this question asked a lot, but none of the solutions I've found have worked for me. As of this week I started getting errors like:

url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found

It's not always from the url_launcher package. It seems to just cycle through which package it's going to throw that error from. I've tried the following things:

  • Removing the ios/Flutter/Flutter.podspec file and running flutter clean
  • Toggled between master, stable and beta Flutter builds in combination with removing the Flutter.podspec.
  • Removing the whole ios directory and running flutter create . to re-create.
  • Re-generating Podfile.
  • Trying different versions of the packages that wind up throwing the error.
  • Various combinations of the above listed items.

Nothing seems to work, so I'm at a bit of a loss here. The android app is still building fine.

Dependencies section of my pubspec:

environment:
  sdk: ">=2.2.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  admob_flutter: ^1.0.1
  after_layout: ^1.0.7+2
  ant_icons: ^1.0.0
  app_review: ^2.0.1
  apple_sign_in: ^0.1.0
  auto_size_text: ^2.1.0
  barcode_scan: ^2.0.2
  basic_utils: ^2.6.3
  bubble_tab_indicator: ^0.1.4
  built_value: ^7.1.0
  built_collection: ^4.3.2
  chips_choice: ^2.0.1
  cloud_firestore: ^0.14.1+2
  dio: 3.0.10
  equatable: ^1.2.5
  file_picker: ^2.1.5
  firebase_core: ^0.5.2+1
  firebase_auth: ^0.18.3+1
  firebase_analytics: ^6.2.0
  firebase_in_app_messaging: ^0.2.2
  flutter_bloc: ^6.1.1
  flutter_chips_input: ^1.9.5
  firebase_crashlytics: ^0.2.3+1
  firebase_dynamic_links: ^0.6.2
  firebase_messaging: 7.0.3
  flutter_form_builder: 4.2.0
  firebase_remote_config: 0.3.0+3
  flutter_launcher_icons: ^0.8.1
  flutter_keyboard_visibility: ^4.0.2
  flutter_signin_button: ^1.1.0
  flutter_spinkit: ^4.1.2+1
  flutter_staggered_grid_view: ^0.3.3
  flutter_svg: ^0.19.2+1
  flutter_switch: 0.2.0
  flutter_typeahead: "<=1.9.1"
  flutter_webview_plugin: ^0.3.11
  font_awesome_flutter: 8.11.0
  get_it: ^5.0.6
  google_sign_in: ^4.5.9
  http: ^0.12.2
  in_app_purchase: ^0.3.5+1
  loading_overlay: ^0.2.1
  loadmore: ^1.0.4
  page_slider: ^0.0.2
  path: ^1.7.0
  path_provider: ^1.6.27
  percent_indicator: ^2.1.9
  share: 0.6.3+6
  sticky_headers: ^0.1.8+1
  tab_indicator_styler: ^1.0.0
  transparent_image: ^1.0.0
  url_launcher: ^5.7.10

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.1+1

dependency_overrides:
  analyzer: ^0.41.2
  intl: ^0.16.0

dev_dependencies:
  flutter_driver:
    sdk: flutter
  test: any
  build_runner: 1.11.0
  built_value_generator: ^7.1.0
Azedarach answered 30/1, 2021 at 15:17 Comment(3)
$ rm ios/Flutter/Flutter.podspec and then $ flutter cleanMesosphere
github.com/flutter/flutter/issues/70895#issuecomment-744734693Mesosphere
Unfortunately, I've tried that multiple times already and it doesn't solve it.Azedarach
P
8

I recently had this issue, executing these commands in Terminal helped me to resolve the issue.

$ rm ios/Flutter/Flutter.podspec
$ rm -fr ios/Pods
$ rm ios/Podfile
$ flutter clean
Phreno answered 1/2, 2021 at 4:52 Comment(8)
I have tried so many solutions, but only this worked for me.Thanks!Martial
That worked perfect for me. ThanksKaiulani
not working for me on Mac m1Keneth
if you are on Mac M1, after 3rd step, run this, arch -x86_64 pod install --repo-updatePhreno
@Phreno Doesn’t work for meSometimes
rm Podfile.lock or Podfile?Fit
no working for meDemount
$ rm ios/Flutter/Flutter.podspec $ rm -fr ios/Pods $ rm ios/Podfile.lock $ arch -x86_64 pod install --repo-update try these maybe.Phreno
C
0

I am using the share extension and none of the answers on SO worked for me. What did work was adjustingenter image description here my Runner build phases so that they are in the order, as seen in the image.

Constringent answered 1/11, 2023 at 9:33 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.