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.7k stars 3.97k forks source link

[fiarebase_auth: Lexical or Preprocessor Issue : non-modular header inside framework module #13280

Closed nissaba closed 1 month ago

nissaba commented 1 month ago

Is there an existing issue for this?

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

Firebase auth is preventing the building of my project. If I remove firebase auth from vergin flutter project ti will build, if it is present it will fail.

Reproducing the issue

1) create a new flutter project. 2) add firebase_core, firebase_auth and cloud_firestore, update pubspec 3) run the project

Firebase Core version

3.4.0

Flutter Version

3.24.1

Relevant Log Output

Could not build the precompiled application for the device.
Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_auth.FLTAuthStateChannelStreamHandler': '/Users/user/StudioProjects/for_fuck_sake/ios/Pods/Headers/Public/Firebase/Firebase.h'
/Users/user/.pub-cache/hosted/pub.dev/firebase_auth-5.2.0/ios/Classes/Private/FLTAuthStateChannelStreamHandler.h:12:8

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_auth.PigeonParser': '/Users/user/StudioProjects/for_fuck_sake/ios/Pods/Headers/Public/Firebase/Firebase.h'
/Users/user/.pub-cache/hosted/pub.dev/firebase_auth-5.2.0/ios/Classes/Private/PigeonParser.h:6:8

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_auth.FLTIdTokenChannelStreamHandler': '/Users/user/StudioProjects/for_fuck_sake/ios/Pods/Headers/Public/Firebase/Firebase.h'
/Users/user/.pub-cache/hosted/pub.dev/firebase_auth-5.2.0/ios/Classes/Private/FLTIdTokenChannelStreamHandler.h:12:8

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_auth.FLTPhoneNumberVerificationStreamHandler': '/Users/user/StudioProjects/for_fuck_sake/ios/Pods/Headers/Public/Firebase/Firebase.h'
/Users/user/.pub-cache/hosted/pub.dev/firebase_auth-5.2.0/ios/Classes/Private/FLTPhoneNumberVerificationStreamHandler.h:12:8

Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'firebase_auth.FLTFirebaseAuthPlugin': '/Users/user/StudioProjects/for_fuck_sake/ios/Pods/Headers/Public/Firebase/Firebase.h'
/Users/user/.pub-cache/hosted/pub.dev/firebase_auth-5.2.0/ios/Classes/Public/FLTFirebaseAuthPlugin.h:6:8

Flutter dependencies

Expand dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.8 firebase_core: ^3.4.0 cloud_firestore: ^5.4.0 firebase_auth: ^5.2.0 snippet
```yaml Replace this line with the contents of your `flutter pub deps -- --style=compact`. ```

Additional context and comments

No response

SelaseKay commented 1 month ago

Hi @nissaba , I'm unable to reproduce this issue. I suspect it could have something to do with your Xcode configurations. Kindly refer here.

pilgrim1385 commented 1 month ago

When I upgraded Xcode to version 16.1.0-Beta, my flutter project couldn’t run on iOS Simulator. Almost same issue, except mine was caused by Crashlytics. After making the following changes, my project ran successfully:

  1. Modified the PROJECT - Runner - Build Settings: CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES

  2. Modified the TARGETS - Runner - Build Settings: CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES

5fe0be54-8158-4b43-bd48-02d42a56f308

  1. Added the following to the Podfile:
    target.build_configurations.each do |config|
    config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
    end

30de4c42-a885-465d-9a39-6db68c2d9c68

  1. run pod install

Then try run your project on iOS.

nissaba commented 1 month ago

When I upgraded Xcode to version 16.1.0-Beta, my flutter project couldn’t run on iOS Simulator. Almost same issue, except mine was caused by Crashlytics. After making the following changes, my project ran successfully:

  1. Modified the PROJECT - Runner - Build Settings: CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
  2. Modified the TARGETS - Runner - Build Settings: CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES

5fe0be54-8158-4b43-bd48-02d42a56f308

  1. Added the following to the Podfile:
target.build_configurations.each do |config|
  config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
end

30de4c42-a885-465d-9a39-6db68c2d9c68

  1. run pod install

Then try run your project on iOS.

This does work. I had found a stackOverflow with the update for the podfile, but they had not included to update the clan module rules.

Thanks!

mikemilla commented 1 month ago

Worked for me too