Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase_core: Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found #16982

Open
1 task done
GG-themastermind opened this issue Jan 17, 2025 · 9 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: core type: bug Something isn't working

Comments

@GG-themastermind
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Core

Which platforms are affected?

iOS

Description

I'm not able to build the IOS app.

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/gg/.pub-cache/hosted/pub.dev/firebase_core-3.10.0/ios/firebase_core/Sources/firebase_core/messages.g.m:14:8

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/gg/.pub-cache/hosted/pub.dev/firebase_core-3.10.0/ios/firebase_core/Sources/firebase_core/include/firebase_core/FLTFirebasePlugin.h:16:8

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/gg/.pub-cache/hosted/pub.dev/firebase_core-3.10.0/ios/firebase_core/Sources/firebase_core/include/firebase_core/FLTFirebaseCorePlugin.h:8:8

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

Reproducing the issue

flutter create
flutter pub add firebase_core

uncomment the first line in the Podfile and modify to 18.1 (or any other):
platform :ios, '18.1'

flutter run

Firebase Core version

3.10.0

Flutter Version

3.27.2

Relevant Log Output

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/gg/.pub-cache/hosted/pub.dev/firebase_core-3.10.0/ios/firebase_core/Sources/firebase_core/messages.g.m:14:8


Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/gg/.pub-cache/hosted/pub.dev/firebase_core-3.10.0/ios/firebase_core/Sources/firebase_core/include/firebase_core/FLTFirebasePlugin.h:16:8


Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/gg/.pub-cache/hosted/pub.dev/firebase_core-3.10.0/ios/firebase_core/Sources/firebase_core/include/firebase_core/FLTFirebaseCorePlugin.h:8:8


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

Flutter dependencies

Expand Flutter dependencies snippet

dependencies:
flutter:
sdk: flutter

The following adds the Cupertino Icons font to your application.

Use with the CupertinoIcons class for iOS style icons.

cupertino_icons: ^1.0.8
firebase_core: ^3.10.0

Additional context and comments

No response

@GG-themastermind GG-themastermind added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Jan 17, 2025
@SelaseKay SelaseKay added plugin: core platform: ios Issues / PRs which are specifically for iOS. labels Jan 17, 2025
@SelaseKay
Copy link
Contributor

Hi @GG-themastermind, what Xcode version are you using?

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jan 17, 2025
@GG-themastermind
Copy link
Author

Hi @GG-themastermind, what Xcode version are you using?

Xcode is version 16.2

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jan 17, 2025
@SelaseKay
Copy link
Contributor

Hi @GG-themastermind, I'm unable to reproduce this on my end. Could you try the following:

  • Delete Pods and Pofile.lock
  • flutter clean.
  • futter run.

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jan 17, 2025
@GG-themastermind
Copy link
Author

I have tried that numerous times already, and unfortunately it does not help.
Also, as you can see it happens to me after I create a completely new project. flutter create

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jan 17, 2025
@GG-themastermind
Copy link
Author

What else can I provide to troubleshoot this? Cause this is completely stopping our development currently.

@SelaseKay
Copy link
Contributor

Please delete your ios folder, run flutter create . to regenerate it, and then try running flutter run again. Also, could you share your Podfile with me?

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jan 17, 2025
@GG-themastermind
Copy link
Author

I have tried that already, and that didn't help.

here is my Podfile:

Uncomment this line to define a global platform for your project

platform :ios, '18.1'

CocoaPods analytics sends network stats synchronously affecting flutter build latency.

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"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jan 17, 2025
@SelaseKay
Copy link
Contributor

I'm still unable to reproduce this issue.

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jan 20, 2025
@MichaelVerdon
Copy link

This looks like it could be an issue with your Flutter installation or project setup. I would recommend trying to run 'flutter doctor' if you have not already or maybe even try reinstalling Flutter itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: core type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants