firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.73k stars 3.98k forks source link

firebase_database: Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module #13342

Closed HeitorCand closed 2 months ago

HeitorCand commented 2 months ago

Is there an existing issue for this?

Which plugins are affected?

Database

Which platforms are affected?

No response

Description

Flutter 3.24.3

Xcode 16

IOS 18

firebase_core: ^3.4.0 firebase_database: ^11.1.1 firebase_storage: ^12.2.0

Launching lib/main_dev.dart on Iphone Heitor in debug mode... Running Xcode build...
└─Compiling, linking and signing... 1.761ms Xcode build done. 38,1s Failed to build iOS app Could not build the precompiled application for the device. Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_database.FLTFirebaseDatabaseObserveStreamHandler': '/Users/heitor.candido/Documents/inteliApp/inteli/ios/Pods/Headers/Public/Firebase/Firebase.h' /Users/heitor.candido/.pub-cache/hosted/pub.dev/firebase_database-11.1.1/ios/Classes/FLTFirebaseDatabaseObserveStreamHandler.h:3:8

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_database.FLTFirebaseDatabasePlugin': '/Users/heitor.candido/Documents/inteliApp/inteli/ios/Pods/Headers/Public/Firebase/Firebase.h' /Users/heitor.candido/.pub-cache/hosted/pub.dev/firebase_database-11.1.1/ios/Classes/FLTFirebaseDatabasePlugin.h:3:8

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_database.FLTFirebaseDatabaseUtils': '/Users/heitor.candido/Documents/inteliApp/inteli/ios/Pods/Headers/Public/Firebase/Firebase.h' /Users/heitor.candido/.pub-cache/hosted/pub.dev/firebase_database-11.1.1/ios/Classes/FLTFirebaseDatabaseUtils.h:3:8

Reproducing the issue

Just add the package and build firebase_core: ^3.4.0 firebase_database: ^11.1.1 firebase_storage: ^12.2.0

Firebase Core version

3.4.0

Flutter Version

3.24.3

Relevant Log Output

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module
'firebase_database.FLTFirebaseDatabaseObserveStreamHandler':
'/Users/heitor.candido/Documents/inteliApp/inteli/ios/Pods/Headers/Public/Firebase/Firebase.h'
/Users/heitor.candido/.pub-cache/hosted/pub.dev/firebase_database-11.1.1/ios/Classes/FLTFirebaseDatabaseObserveStreamHandler.h:3:8

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module
'firebase_database.FLTFirebaseDatabasePlugin':
'/Users/heitor.candido/Documents/inteliApp/inteli/ios/Pods/Headers/Public/Firebase/Firebase.h'
/Users/heitor.candido/.pub-cache/hosted/pub.dev/firebase_database-11.1.1/ios/Classes/FLTFirebaseDatabasePlugin.h:3:8

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module
'firebase_database.FLTFirebaseDatabaseUtils':
'/Users/heitor.candido/Documents/inteliApp/inteli/ios/Pods/Headers/Public/Firebase/Firebase.h'
/Users/heitor.candido/.pub-cache/hosted/pub.dev/firebase_database-11.1.1/ios/Classes/FLTFirebaseDatabaseUtils.h:3:8

Flutter dependencies

cupertino_icons: ^1.0.8 firebase_core: ^3.4.0 firebase_database: ^11.1.1 firebase_storage: ^12.2.0 flutter_dotenv: ^5.1.0

amplify_flutter: ^2.4.0 amplify_auth_cognito: ^2.4.0 amplify_authenticator: ^2.1.2 amplify_core: ^2.4.0 amplify_secure_storage: ^0.5.5 flutter_bloc: ^8.1.6 lottie: ^3.1.2 flutter_svg: ^2.0.10+1 http: ^1.2.2 hive_flutter: ^1.1.0 hive: ^2.2.3

Additional context and comments

No response

gigamike commented 2 months ago

I also encountered this when I updated Xcode due to the new ios18 simulator and installed package:firebase_messaging

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_messaging.FLTFirebaseMessagingPlugin': '/ios/Pods/Headers/Public/Firebase/Firebase.h' /.pub-cache/hosted/pub.dev/firebase_messaging-15.1.0/ios/Classes/FLTFirebaseMessagingPlugin.h:11:8

ShaunAtSense commented 2 months ago

I just updated to Xcode 16 and started receiving this error when using iOS 18.

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_messaging.FLTFirebaseMessagingPlugin': '/ios/Pods/Headers/Public/Firebase/Firebase.h' /.pub-cache/hosted/pub.dev/firebase_messaging-15.1.1/ios/Classes/FLTFirebaseMessagingPlugin.h:11:8

SelaseKay commented 2 months ago

Hi @HeitorCand , this issue appears to be a duplicate. 13323

mohibrehman11 commented 2 months ago

"I encountered the same issue after updating to iOS 16 two days ago. Despite multiple attempts to resolve it, I have been unable to find a solution."

DevClement commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

dantodsky commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

you are very very very great. . thank you so much. .

toykam commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

i cant find this option in my xcode 16.

DevClement commented 2 months ago

I found a solution. You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

i cant find this option in my xcode 16.

You have to open your project on Xcode, you click on the runner and then on the left then on the top, you have build settings. And for the option check all and you have a magnifying glass to do the search

adrianorios commented 2 months ago

I found a solution. You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

i cant find this option in my xcode 16.

You have to go to Xcode => Runner => Build Settings => All and put "Allow Non-modular Includes In Framework Modules" to yes.

For me its ok!!

krszozda commented 2 months ago

It's working but I have next step in this issue: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O,

somebody something? :)

iamnabink commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

Anyone why we have to do this?

emirgangs commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

thank you so much brother <3 you saved us

NguyenHuuPhuc commented 2 months ago
Screenshot 2024-09-23 at 09 30 24

Change to 'Yes' But in my case, Xcode build extremely slow.

therngbtg commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

Thank you :)

ibrhm117-togo commented 2 months ago

I don't seem to have this option in my XCode version 16

Screenshot 2024-09-23 at 12 37 22 PM
bonaparta13 commented 2 months ago

I don't seem to have this option in my XCode version 16

Screenshot 2024-09-23 at 12 37 22 PM

make sure to select ALL Screenshot 2024-09-23 at 11 52 42 AM

auliaridhov commented 2 months ago

I found a solution. You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

Anyone why we have to do this?

Does anyone know why? Is there any issue with security?

krszozda commented 2 months ago

Somebody can run some flutter project on iOS? I have each all some errors..

adrianorodesousa commented 2 months ago

Allow Non-modular Includes In Framework Modules

You're my hero! Thanks <3

tfyilmaz commented 2 months ago

I am having the same issue on my flutter project and dont know what to do. Any help would be much appreciated.

afaqxdev commented 2 months ago

Its work for me

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

bunthoeun-develop commented 2 months ago

Anyone know why need to do it?

anshidp commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

great this is working 👍

wasilni2022 commented 2 months ago

Allowing "Non-modular Includes in Framework Modules" will cause massive runtime issues later on. This is not a solution, you are slowly destroying your project. Do not do it! Wait until a new version of the package is ready!

borisbokan commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

Thanks :)

fikretsengul commented 2 months ago

I get the same error why this is closed?

ILexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_messaging.FLTFirebaseMessagingPlugin': '/Users/fikretsengul/Workspace/Quattro.Mobile.Refactor/app/ios/Pods/Headers/Public/Firebase/Firebase.h' /Users/fikretsengul/.pub-cache/hosted/pub.dev/firebase_messaging-15.1.2/ios/Classes/FLTFirebaseMessagingPlugin.h:11:8

AhmadEshbailat commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

Well done! It worked with me after few days of search, thanks I faced this issue in while working Flutter Tabby SDK integration.

goj1 commented 2 months ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

Great job! Thank you!

BeshoyMelika commented 1 month ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

Great job! Thank you!

aekkachan commented 1 month ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

bro you saved my life, big thank

danielkiing3 commented 1 month ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

Thank you very much, God bless you I've been battling with this for over 2 weeks now😭

This is just solved my phone

lisbonc1987 commented 1 month ago

I was getting the exact error and I changed the build settings like what @DevClement suggested. But I was reading through and saw @wasilni2022 so I didn't want to take the risk. I noticed this started happening when I used Clean My Mac (I have since deleted) and it deleted my simulator settings so I added a new one with IOS 18. What I ended up doing that worked for me without changing the build settings is to run the following commands in the root of your project:

flutter clean flutter pub get cd ios pod deintegrate pod install --repo-update cd ..

I had a pod error at this point. I went to ios/Pods/Local Podspecs directory and looked at every single json file to see what's the highest IOS version on every single one. The highest on mine was "iOS": "13.0"

I went to project/iOS/Podfile and changed the platform :iOS, "xx.x" to the highest iOS values in my json files from above, which is 13.

I then ran the below command on the iOS folder of your project:

pod update Firebase/Auth

Then I navigate to the iOS folder of my project and ran:

pod install flutter build iOS

It worked! I am basing all of these on memory so I may have missed something but hopefully this helps someone out.

bawantha commented 1 month ago

just happened to me

theoheneba commented 1 month ago

I found a solution.

You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"

Thank you very much, it work

Jonas-Sander commented 1 month ago

Allowing "Non-modular Includes in Framework Modules" will cause massive runtime issues later on. This is not a solution, you are slowly destroying your project. Do not do it! Wait until a new version of the package is ready!

Why and what runtime issues exactly?