Flutter.h not found error Flutter.h not found error dart dart

Flutter.h not found error


I guess this problem is caused by interrupting cocoapods install. Here's fix:

  • Remove ios/Flutter/Flutter.framework from your project
  • Run pod install in ios directory. Flutter.framework should be generated, including Headers/Flutter.h file
  • Run build. Everything should be working now

While switching to a different Flutter might work, it doesn't really solves a broken cache problem. Keep in mind that master and beta branches of Flutter are not suitable for production release.


For Anyone that comes here is 2021

Replace your pod file with this one

platform :ios, '12.0'ENV['COCOAPODS_DISABLE_STATS'] = 'true'project 'Runner', {  'Debug' => :debug,  'Profile' => :release,  'Release' => :release,}def flutter_root  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)  unless File.exist?(generated_xcode_build_settings_path)    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"  end  File.foreach(generated_xcode_build_settings_path) do |line|    matches = line.match(/FLUTTER_ROOT\=(.*)/)    return matches[1].strip if matches  end  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"endrequire File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)flutter_ios_podfile_setupdef flutter_install_ios_plugin_pods(ios_application_path = nil)  ios_application_path ||= File.dirname(defined_in_file.realpath) if self.respond_to?(:defined_in_file)  raise 'Could not find iOS application path' unless ios_application_path  symlink_dir = File.expand_path('.symlinks', ios_application_path)  system('rm', '-rf', symlink_dir) # Avoid the complication of dependencies like FileUtils.  symlink_plugins_dir = File.expand_path('plugins', symlink_dir)  system('mkdir', '-p', symlink_plugins_dir)  plugins_file = File.join(ios_application_path, '..', '.flutter-plugins-dependencies')  plugin_pods = flutter_parse_plugins_file(plugins_file)  plugin_pods.each do |plugin_hash|    plugin_name = plugin_hash['name']    plugin_path = plugin_hash['path']    if (plugin_name && plugin_path)      symlink = File.join(symlink_plugins_dir, plugin_name)      File.symlink(plugin_path, symlink)      if plugin_name == 'flutter_ffmpeg'          pod 'flutter_ffmpeg/full-lts', :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')      else          pod plugin_name, :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')      end    end  endendtarget 'Runner' do  use_frameworks!  use_modular_headers!  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))endpost_install do |installer|  installer.pods_project.targets.each do |target|    flutter_additional_ios_build_settings(target)  endend

And Run

flutter pub getcd iospod install

EDIT

if it doesn't work then

pod updateflutter cleanflutter run

@Credit Latalus


I was also facing same issue and spent around 2 days to solve it by trying numerous solution over internet but finally solution which worked for me:Flutter fatal error: ‘Flutter/Flutter.h’ file not found