Skip to content

[firebase_core] iOS could not build module 'firebase_core' #3272

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

Closed
andrsdev opened this issue Aug 20, 2020 · 60 comments
Closed

[firebase_core] iOS could not build module 'firebase_core' #3272

andrsdev opened this issue Aug 20, 2020 · 60 comments
Assignees
Labels
Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: core resolution: needs-repro This issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin.

Comments

@andrsdev
Copy link

Describe the bug
Updated to firebase core 0.5.0, and new plugin versions.

To Reproduce

  1. Create a new flutter project
  2. Install the following plugins:
  firebase_core: 0.5.0
  firebase_auth: 0.18.0+1
  firebase_storage: 4.0.0
  firebase_messaging: 7.0.0
  cloud_functions: 0.6.0
  cloud_firestore: 0.14.0+1
  firebase_database: 4.0.0
  firebase_dynamic_links: 0.6.0
  firebase_analytics: 6.0.0
  firebase_remote_config: 0.4.0
  1. Run the application on iOS Simulator
  2. The following error appears:
.../.pub-cache/hosted/pub.dartlang.org/firebase_database-4.0.0/ios/Classes/FLTFirebaseDatab
    asePlugin.m:8:9: fatal error: could not build module 'firebase_core'
    #import <firebase_core/FLTFirebasePlugin.h>
     ~~~~~~~^

Expected behavior
A successful build for the iOS simulator

Flutter doctor

[✓] Flutter (Channel stable, 1.20.1, on Mac OS X 10.15.6 19G2021, locale en)
    • Flutter version 1.20.1 at /Users/andrs/Library/flutter
    • Framework revision 2ae34518b8 (2 weeks ago), 2020-08-05 19:53:19 -0700
    • Engine revision c8e3b94853
    • Dart version 2.9.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/andrs/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.48.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.13.2

[✓] Connected device (1 available)
    • iPhone 11 Pro (mobile) • 5733377A-4BD7-42F9-9453-C7B123A5C3CB • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)

Complete output

Launching lib/main.dart on iPhone 11 Pro in debug mode...
 
                                            
Running pod install...                                             22.3s
Running Xcode build...                                                  
                                                   
Xcode build done.                                           159.8s
Failed to build iOS app
Error output from Xcode build:
↳
    2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning:  The file reference for
    "Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h" is a member of multiple
    groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.
    Only the membership in one of the groups will be preserved (but membership in targets will be
    unaffected).  If you want a reference to the same file in more than one group, please add another
    reference to the same path.
    2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning:  The file reference for
    "Objective-C/TOCropViewController/Views/TOCropOverlayView.h" is a member of multiple groups
    ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the
    membership in one of the groups will be preserved (but membership in targets will be unaffected).
    If you want a reference to the same file in more than one group, please add another reference to the
    same path.
    2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning:  The file reference for
    "Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h" is a member of multiple groups
    ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the
    membership in one of the groups will be preserved (but membership in targets will be unaffected).
    If you want a reference to the same file in more than one group, please add another reference to the
    same path.
    2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning:  The file reference for
    "Objective-C/TOCropViewController/Views/TOCropScrollView.h" is a member of multiple groups
    ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the
    membership in one of the groups will be preserved (but membership in targets will be unaffected).
    If you want a reference to the same file in more than one group, please add another reference to the
    same path.
    2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning:  The file reference for
    "Objective-C/TOCropViewController/Views/TOCropToolbar.h" is a member of multiple groups
    ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the
    membership in one of the groups will be preserved (but membership in targets will be unaffected).
    If you want a reference to the same file in more than one group, please add another reference to the
    same path.
    2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning:  The file reference for
    "Objective-C/TOCropViewController/Views/TOCropView.h" is a member of multiple groups
    ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the
    membership in one of the groups will be preserved (but membership in targets will be unaffected).
    If you want a reference to the same file in more than one group, please add another reference to the
    same path.
    2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning:  The file reference for
    "Objective-C/TOCropViewController/TOCropViewController.h" is a member of multiple groups
    ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the
    membership in one of the groups will be preserved (but membership in targets will be unaffected).
    If you want a reference to the same file in more than one group, please add another reference to the
    same path.
    2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning:  The file reference for
    "Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h" is a member of
    multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed
    project.  Only the membership in one of the groups will be preserved (but membership in targets will
    be unaffected).  If you want a reference to the same file in more than one group, please add another
    reference to the same path.
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.0.13/ios/Classes/QRView.swift:47:2
    5: warning: variable 'arguments' was never mutated; consider changing to 'let' constant
                        var arguments = call.arguments as! Dictionary<String, Double>
                        ~~~ ^
                        let
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.0.13/ios/Classes/QRViewFactory.swi
    ft:20:13: warning: variable 'dictionary' was never mutated; consider changing to 'let' constant
            var dictionary =  args as! Dictionary<String, Double>
            ~~~ ^
            let
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-7.0.0/ios/Classes/FLTFirebaseMess
    agingPlugin.m:190:43: warning: 'FIRMessagingRemoteMessage' is deprecated: FCM direct channel is
    deprecated, please use APNs for downstream message handling. [-Wdeprecated-declarations]
    - (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage {
                                              ^
    In module 'FirebaseMessaging' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/Firebase/Fireba
    se.h:72:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/FirebaseMessaging/FirebaseMess
    aging/Sources/Public/FIRMessaging.h:219:1: note: 'FIRMessagingRemoteMessage' has been explicitly
    marked deprecated here
    __deprecated_msg(
    ^
    In module 'Foundation' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/FirebaseCore/FI
    RApp.h:17:
    In module 'CoreFoundation' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/usr/include/sys/cdefs.h:191:48: note: expanded from macro '__deprecated_msg'
            #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                          ^
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-7.0.0/ios/Classes/FLTFirebaseMess
    agingPlugin.m:290:24: warning: 'FIRMessagingRemoteMessage' is deprecated: FCM direct channel is
    deprecated, please use APNs for downstream message handling. [-Wdeprecated-declarations]
        didReceiveMessage:(FIRMessagingRemoteMessage *)remoteMessage {
                           ^
    In module 'FirebaseMessaging' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/Firebase/Fireba
    se.h:72:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/FirebaseMessaging/FirebaseMess
    aging/Sources/Public/FIRMessaging.h:219:1: note: 'FIRMessagingRemoteMessage' has been explicitly
    marked deprecated here
    __deprecated_msg(
    ^
    In module 'Foundation' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/FirebaseCore/FI
    RApp.h:17:
    In module 'CoreFoundation' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/usr/include/sys/cdefs.h:191:48: note: expanded from macro '__deprecated_msg'
            #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                          ^
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-7.0.0/ios/Classes/FLTFirebaseMess
    agingPlugin.m:136:30: warning: 'shouldEstablishDirectChannel' is deprecated: FCM direct channel is
    deprecated, please use APNs channel for downstream message delivery. [-Wdeprecated-declarations]
        [FIRMessaging messaging].shouldEstablishDirectChannel = true;
                                 ^
    In module 'FirebaseMessaging' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/Firebase/Fireba
    se.h:72:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/FirebaseMessaging/FirebaseMess
    aging/Sources/Public/FIRMessaging.h:283:56: note: 'shouldEstablishDirectChannel' has been explicitly
    marked deprecated here
    @property(nonatomic) BOOL shouldEstablishDirectChannel DEPRECATED_MSG_ATTRIBUTE(
                                                           ^
    In module 'Foundation' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/FirebaseCore/FI
    RApp.h:17:
    In module 'CoreFoundation' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/usr/include/AvailabilityMacros.h:182:64: note: expanded from macro
    'DEPRECATED_MSG_ATTRIBUTE'
                #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                                   ^
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-7.0.0/ios/Classes/FLTFirebaseMess
    agingPlugin.m:191:52: warning: 'appData' is deprecated [-Wdeprecated-declarations]
      [self didReceiveRemoteNotification:remoteMessage.appData];
                                                       ^
    In module 'FirebaseMessaging' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/Firebase/Fireba
    se.h:72:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/FirebaseMessaging/FirebaseMess
    aging/Sources/Public/FIRMessaging.h:226:62: note: 'appData' has been explicitly marked deprecated
    here
    @property(nonatomic, readonly, strong) NSDictionary *appData DEPRECATED_ATTRIBUTE;
                                                                 ^
    In module 'Foundation' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/FirebaseCore/FI
    RApp.h:17:
    In module 'CoreFoundation' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/usr/include/AvailabilityMacros.h:180:60: note: expanded from macro
    'DEPRECATED_ATTRIBUTE'
            #define DEPRECATED_ATTRIBUTE        __attribute__((deprecated))
                                                               ^
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-7.0.0/ios/Classes/FLTFirebaseMess
    agingPlugin.m:289:1: warning: implementing deprecated method [-Wdeprecated-implementations]
    - (void)messaging:(FIRMessaging *)messaging
    ^
    In module 'FirebaseMessaging' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/Firebase/Fireba
    se.h:72:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/FirebaseMessaging/FirebaseMess
    aging/Sources/Public/FIRMessaging.h:253:1: note: method 'messaging:didReceiveMessage:' declared here
    - (void)messaging:(FIRMessaging *)messaging
    ^
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-7.0.0/ios/Classes/FLTFirebaseMess
    agingPlugin.m:291:63: warning: 'appData' is deprecated [-Wdeprecated-declarations]
      [_channel invokeMethod:@"onMessage" arguments:remoteMessage.appData];
                                                                  ^
    In module 'FirebaseMessaging' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/Firebase/Fireba
    se.h:72:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/FirebaseMessaging/FirebaseMess
    aging/Sources/Public/FIRMessaging.h:226:62: note: 'appData' has been explicitly marked deprecated
    here
    @property(nonatomic, readonly, strong) NSDictionary *appData DEPRECATED_ATTRIBUTE;
                                                                 ^
    In module 'Foundation' imported from
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/FirebaseCore/FI
    RApp.h:17:
    In module 'CoreFoundation' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneS
    imulator13.6.sdk/usr/include/AvailabilityMacros.h:180:60: note: expanded from macro
    'DEPRECATED_ATTRIBUTE'
            #define DEPRECATED_ATTRIBUTE        __attribute__((deprecated))
                                                               ^
    6 warnings generated.
    While building module 'firebase_core' imported from
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_database-4.0.0/ios/Classes/FLTFirebaseDatab
    asePlugin.m:8:
    In file included from <module-includes>:1:
    In file included from /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Target
    Support Files/firebase_core/firebase_core-umbrella.h:13:
    In file included from
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/ios/Classes/FLTFirebaseCorePlugi
    n.h:11:
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/ios/Classes/FLTFirebasePlugin.h:
    9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin':
    '/Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/FirebaseCore/F
    irebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
    #import <FirebaseCore/FirebaseCore.h>
            ^
    1 error generated.
    /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_database-4.0.0/ios/Classes/FLTFirebaseDatab
    asePlugin.m:8:9: fatal error: could not build module 'firebase_core'
    #import <firebase_core/FLTFirebasePlugin.h>
     ~~~~~~~^
    2 errors generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/TOCropViewController/Objective
    -C/TOCropViewController/Models/TOActivityCroppedImageProvider.h (in target 'TOCropViewController'
    from project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/TOCropViewController/Objective
    -C/TOCropViewController/Views/TOCropOverlayView.h (in target 'TOCropViewController' from project
    'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/TOCropViewController/Objective
    -C/TOCropViewController/Models/TOCroppedImageAttributes.h (in target 'TOCropViewController' from
    project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/TOCropViewController/Objective
    -C/TOCropViewController/Views/TOCropScrollView.h (in target 'TOCropViewController' from project
    'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/TOCropViewController/Objective
    -C/TOCropViewController/Views/TOCropToolbar.h (in target 'TOCropViewController' from project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/TOCropViewController/Objective
    -C/TOCropViewController/Views/TOCropView.h (in target 'TOCropViewController' from project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/TOCropViewController/Objective
    -C/TOCropViewController/TOCropViewController.h (in target 'TOCropViewController' from project
    'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/TOCropViewController/Objective
    -C/TOCropViewController/Models/TOCropViewControllerTransitioning.h (in target 'TOCropViewController'
    from project 'Pods')

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.
@Kedar-27
Copy link

Facing same issue

@dcchristopher
Copy link

No amount of cleaning (flutter, pods, etc.) helped. Reverting to the penultimate version did the trick.

@Kedar-27
Copy link

Kedar-27 commented Aug 21, 2020

No amount of cleaning (flutter, pods, etc.) helped. Reverting to the penultimate version did the trick.

Which version ??.. i am using latest one
image_cropper: ^1.3.0 .... v1.2.3 also didnt work for me

@dcchristopher
Copy link

dcchristopher commented Aug 21, 2020

No amount of cleaning (flutter, pods, etc.) helped. Reverting to the penultimate version did the trick.

Which version ??.. i am using latest one
image_cropper: ^1.3.0

Are you stating that the above error about firebase_core was caused by a later version of image_cropper? If so, that's news to me. However, for those who just updated all their flutter dependencies and got the latest firebase_* plugins (pretty much all were updated around 8/17), just go to the version right before the most recent one (for each firebase plugin). For example, I had to revert mine to the following:

firebase_core: ^0.4.5
firebase_analytics: ^5.0.16
firebase_remote_config: ^0.3.1+1

@Kedar-27
Copy link

No amount of cleaning (flutter, pods, etc.) helped. Reverting to the penultimate version did the trick.

Which version ??.. i am using latest one
image_cropper: ^1.3.0

Are you stating that the above error about firebase_core was caused by a later version of image_cropper? If so, that's news to me. However, for those who just updated all their flutter dependencies and got the latest firebase_* plugins (pretty much all were updated around 8/17), just go to the version right before the most recent one (for each firebase plugin). For example, I had to revert mine to the following:

firebase_core: ^0.4.5
firebase_analytics: ^5.0.16
firebase_remote_config: ^0.3.1+1

Was talking about this issue

2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning: The file reference for
"Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h" is a member of multiple
groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.
Only the membership in one of the groups will be preserved (but membership in targets will be
unaffected). If you want a reference to the same file in more than one group, please add another
reference to the same path.

@dcchristopher
Copy link

No amount of cleaning (flutter, pods, etc.) helped. Reverting to the penultimate version did the trick.

Which version ??.. i am using latest one
image_cropper: ^1.3.0

Are you stating that the above error about firebase_core was caused by a later version of image_cropper? If so, that's news to me. However, for those who just updated all their flutter dependencies and got the latest firebase_* plugins (pretty much all were updated around 8/17), just go to the version right before the most recent one (for each firebase plugin). For example, I had to revert mine to the following:
firebase_core: ^0.4.5
firebase_analytics: ^5.0.16
firebase_remote_config: ^0.3.1+1

Was talking about this issue

2020-08-20 16:25:08.109 xcodebuild[69982:2371607] warning: The file reference for
"Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h" is a member of multiple
groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.
Only the membership in one of the groups will be preserved (but membership in targets will be
unaffected). If you want a reference to the same file in more than one group, please add another
reference to the same path.

Those look more like warnings to me. The OP is referring to these errors:

While building module 'firebase_core' imported from /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_database-4.0.0/ios/Classes/FLTFirebaseDatab asePlugin.m:8: In file included from <module-includes>:1: In file included from /Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13: In file included from /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/ios/Classes/FLTFirebaseCorePlugi n.h:11: /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/ios/Classes/FLTFirebasePlugin.h: 9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/andrs/Documents/Projects/Tutting/Software/student_app/ios/Pods/Headers/Public/FirebaseCore/F irebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module] #import <FirebaseCore/FirebaseCore.h> ^ 1 error generated. /Users/andrs/.pub-cache/hosted/pub.dartlang.org/firebase_database-4.0.0/ios/Classes/FLTFirebaseDatab asePlugin.m:8:9: fatal error: could not build module 'firebase_core' #import <firebase_core/FLTFirebasePlugin.h> ~~~~~~~^

@andrsdev
Copy link
Author

@dcchristopher @Kedar-27 the isuue is about the firebase_core, the logs about TOCropViewController are warnings generated by Xcode, but I insist the error is the following:

/.pub-cache/hosted/pub.dartlang.org/firebase_database-4.0.0/ios/Classes/FLTFirebaseDatab
    asePlugin.m:8:9: fatal error: could not build module 'firebase_core'
    #import <firebase_core/FLTFirebasePlugin.h>
     ~~~~~~~^

@Beautylivery
Copy link

Running into the same error

Failed to build iOS app
Error output from Xcode build:
↳
    2020-08-22 20:29:07.046 xcodebuild[14582:63993] warning:  The file reference for "Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h" is a member of multiple groups ("TOCropViewController" and "TOCropViewController"); this
    indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the
    same path.
    2020-08-22 20:29:07.046 xcodebuild[14582:63993] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropOverlayView.h" is a member of multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a
    malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
    2020-08-22 20:29:07.046 xcodebuild[14582:63993] warning:  The file reference for "Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h" is a member of multiple groups ("TOCropViewController" and "TOCropViewController"); this
    indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the
    same path.
    2020-08-22 20:29:07.046 xcodebuild[14582:63993] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropScrollView.h" is a member of multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a
    malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
    2020-08-22 20:29:07.046 xcodebuild[14582:63993] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropToolbar.h" is a member of multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a
    malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
    2020-08-22 20:29:07.046 xcodebuild[14582:63993] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropView.h" is a member of multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a
    malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
    2020-08-22 20:29:07.046 xcodebuild[14582:63993] warning:  The file reference for "Objective-C/TOCropViewController/TOCropViewController.h" is a member of multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a
    malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
    2020-08-22 20:29:07.046 xcodebuild[14582:63993] warning:  The file reference for "Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h" is a member of multiple groups ("TOCropViewController" and "TOCropViewController");
    this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to
    the same path.
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/kaibaier/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_appcenter_bundle-3.2.0+2/ios/Classes/SwiftFlutterAppcenterBundlePlugin.swift:20:9: warning: result of call to 'register(binaryMessenger:)' is unused
            register(binaryMessenger: registrar.messenger());
            ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    While building module 'firebase_core' imported from /Users/kaibaier/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/firebase_storage-4.0.0/ios/Classes/FLTFirebaseStoragePlugin.m:8:
    In file included from <module-includes>:1:
    In file included from /Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13:
    In file included from /Users/kaibaier/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/firebase_core-0.5.0/ios/Classes/FLTFirebaseCorePlugin.h:11:
    /Users/kaibaier/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/firebase_core-0.5.0/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin':
    '/Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
    #import <FirebaseCore/FirebaseCore.h>
            ^
    1 error generated.
    /Users/kaibaier/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/firebase_storage-4.0.0/ios/Classes/FLTFirebaseStoragePlugin.m:8:9: fatal error: could not build module 'firebase_core'
    #import <firebase_core/FLTFirebasePlugin.h>
     ~~~~~~~^
    2 errors generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h (in target
    'TOCropViewController' from project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropOverlayView.h (in target 'TOCropViewController' from
    project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h (in target
    'TOCropViewController' from project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropScrollView.h (in target 'TOCropViewController' from
    project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropToolbar.h (in target 'TOCropViewController' from
    project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropView.h (in target 'TOCropViewController' from
    project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.h (in target 'TOCropViewController' from
    project 'Pods')
    warning: Skipping duplicate build file in Copy Headers build phase:
    /Users/kaibaier/Me/Entwicklung/Project_Beautylivery/Flutter/Projects/beautylivery-flutter-ac/beautylivervy_appcenter/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h (in target
    'TOCropViewController' from project 'Pods')

Could not build the precompiled application for the device.
Kais-MacBook-Pro:beautylivervy_appcenter kaibaier$ flutter doctor -v
[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G2021, locale de-DE)
    • Flutter version 1.20.2 at /Users/kaibaier/development/flutter
    • Framework revision bbfbf1770c (9 days ago), 2020-08-13 08:33:09 -0700
    • Engine revision 9d5b21729f
    • Dart version 2.9.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/kaibaier/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/kaibaier/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 48.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.48.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.13.2

[✓] Connected device (2 available)
    • Redmi Note 8 (mobile) • 18d3ce30                  • android-arm64 • Android 9 (API 28)
    • Kai (mobile)          • 00008020-0019348C3491002E • ios           • iOS 13.6

@vercorro
Copy link

Just updated my firebase dependencies and got the same issue. Tried every imaginable clean and rebuild but the error is still here.

6 warnings generated. While building module 'firebase_core' imported from /Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-4.0.0/ios/Classes/FLTFirebaseStoragePlugin.m:8: In file included from <module-includes>:1: In file included from /Users/admin/Desktop/lit/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13: In file included from /Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/ios/Classes/FLTFirebaseCorePlugin.h:11: /Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/admin/Desktop/lit/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module] #import <FirebaseCore/FirebaseCore.h> ^ 1 error generated. /Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-4.0.0/ios/Classes/FLTFirebaseStoragePlugin.m:8:9: fatal error: could not build module 'firebase_core' #import <firebase_core/FLTFirebasePlugin.h> ~~~~~~~^ 2 errors generated. note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description

@hyiip
Copy link

hyiip commented Aug 22, 2020

I have time same issue, have you use package image_cropper?

@vercorro
Copy link

I have time same issue, have you use package image_cropper?

nope but I use crop: ^0.4.0 .

@Beautylivery
Copy link

I tried just removing the image cropper ..... the firebase issues still remain on iOS and prevent my builds :(

@dcchristopher
Copy link

I tried just removing the image cropper ..... the firebase issues still remain on iOS and prevent my builds :(

Have you tried reverting to the version of firebase dependencies right before the most recent ones that came out just a few days ago?

@Beautylivery
Copy link

Beautylivery commented Aug 23, 2020

Here is a list of my current dependencies resulting in the error on iOS .... the # ones are the ones i used before and everything was working (besides super slow build times)


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: ^0.1.3
  # Firebase dependencies for all connections to the firebase components
  firebase_core: ^0.5.0 #^0.4.5
  firebase_auth: ^0.18.0+1 #^0.16.1
  firebase_storage: ^4.0.0 #^3.1.6
  cloud_firestore: ^0.14.0+2 #^0.13.7
  #Provider Package for Stream solution over the whole plattform
  provider: ^4.3.2 #^4.0.4
  #flutter spinkit and additional vector icons
  flutter_spinkit: ^4.1.2+1 #^4.1.2
  flutter_vector_icons: ^0.2.1
  #intl for localization and calculaitons on currency
  intl: ^0.16.1
  #image croppper and picker for image management
  image_cropper: ^1.3.0 #^1.2.1
  image_picker: ^0.6.7+4 #^0.6.3
  #searchable Dropdown
  searchable_dropdown: ^1.1.3
  #Pick colors
  flutter_colorpicker: ^0.3.4
  #Mask Text that is going beyond borders
  flutter_masked_text: ^0.8.0
  #Shared Preferences over the wholeApplication
  shared_preferences: ^0.5.8 #^0.5.7+3
  #Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories.
  path_provider: ^1.6.11
  #For Geolocation
  geolocator: ^5.3.2+2
  location: ^3.0.2
  #Microsoft Visual Studio Appcenter for Analytics
  flutter_appcenter_bundle: ^3.2.0+2
  #Experimantal
  preload_page_view: ^0.1.4
  device_preview: ^0.4.8 #^0.4.5

@dcchristopher
Copy link

So the point I've been painstakingly trying to make is that for now you have to roll back to your previous firebase versions (the ones after the #). Once the firebase team fixes the issues introduced in their latest release I'm sure there will be an update in this thread.

@Beautylivery
Copy link

Certainly i can do that. This however remains another error i will not get rid off and this is build times of 10 to 30 minutes . I was actually hoping to get rid of these with the new updates.

Therefore i will now wait instead of reverting.

Thanks dcchristopher for your fast replies and support :)

@DeadPixel-ANTH
Copy link

Seeing same issue here. I'm not using Image Cropper either. Has occurred since I tried to use firebase_ml_vision 0.9.6+2

Have cleaned, updated, rebuilt pods - the works.

@Beautylivery
Copy link

Would you share the exact commands and where you executed them ? flutter dir or iOS dir ? ... it might worth to try again.

@Salakar
Copy link
Member

Salakar commented Aug 23, 2020

To confirm, is everyone here using a Swift iOS project instead of obj-c?

@Salakar Salakar added blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: core labels Aug 23, 2020
@vercorro
Copy link

To confirm, is everyone here using a Swift iOS project instead of obj-c?

Yes my friend .

@Beautylivery
Copy link

Is it possible to change the projects in flutter ? I use base configuration with VS Code ...
Let me know where i could check it...

@Salakar
Copy link
Member

Salakar commented Aug 24, 2020

Bit of a weird long shot, but can some try remove this line locally and clear all caches etc and rebuild (ensuring that pod install does get run as part of the build): https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_core/firebase_core/ios/firebase_core.podspec#L29

If you look in .flutter-plugins or ios/.symlinks you should be able to find the path to your local pub cached version of firebase_core - can then modify it in that location to make that line removal change.

@Beautylivery
Copy link

Hi... i think i can try it... dont know however if i will execute it right ... but a remark ...
the file looks very different to the GitHub one


#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

require 'yaml'
pubspec = YAML.load_file(File.join('..', 'pubspec.yaml'))
libraryVersion = pubspec['version'].gsub('+', '-')

Pod::Spec.new do |s|
  s.name             = 'firebase_core'
  s.version          = '0.0.1'
  s.summary          = 'A new flutter plugin project.'
  s.description      = <<-DESC
A new flutter plugin project.
                       DESC
  s.homepage         = 'http://example.com'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Your Company' => '[email protected]' }
  s.source           = { :path => '.' }
  s.source_files = 'Classes/**/*'
  s.public_header_files = 'Classes/**/*.h'
  s.dependency 'Flutter'
  s.dependency 'Firebase/Core'
  s.ios.deployment_target = '8.0'
  s.static_framework = true

  s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => "LIBRARY_VERSION=\\@\\\"#{libraryVersion}\\\" LIBRARY_NAME=\\@\\\"flutter-fire-core\\\"" }
end

@Beautylivery
Copy link

@andrsdev in my CI / CD it actualy takes it as critically ( using AppCenter to build ) :( ... might need to wait till this can be solved... but at least i can continue testing

@nmhung
Copy link

nmhung commented Aug 24, 2020

OMG it seems i found my issue ....

It was quite stupid... and i believe, I can 100 % relate to what has happend, but if you like to recreate it ....
I did a modification to my Pod file as i think there was some requirement to get Firebase running....

however i same to have made that one totally wrong....

Before


# Uncomment this line to define a global platform for your project
platform :ios, '9.0'

# 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__))
end

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

 # Added by KAI
  pod 'Firebase/Firestore'
  pod 'Firebase/Core'
  # add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'
  # add pods for any other desired Firebase products
  # https://firebase.google.com/docs/ios/setup#available-pods
  pod 'Firebase/Auth'
  pod 'Firebase/Functions'
  pod 'Firebase/Storage'

after


# Uncomment this line to define a global platform for your project
platform :ios, '9.0'

# 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
  # Added by KAI
  pod 'Firebase/Firestore'
  pod 'Firebase/Core'
  # add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'
  # add pods for any other desired Firebase products
  # https://firebase.google.com/docs/ios/setup#available-pods
  pod 'Firebase/Auth'
  pod 'Firebase/Functions'
  pod 'Firebase/Storage'
  #End
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

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

seems i just completely moved it out of the realistic range within the POD file... not really sure why i did it in the first place and totally forgot about it until i was reading something about optimisation of the Firebase build ... which i tried in parallel and it worked :D

....
ok there was one more tweek as i first had a blank screen... forgot about that
https://stackoverflow.com/questions/45317777/could-not-find-a-valid-googleservice-info-plist-in-your-project

Thank you so much. I faced the same issue last night. This morning I was reading this and then my issue is gone.

@fogelfish
Copy link

Catching up with this issue, has someone proposed a solution? (I posted a duplicate issue while trying the example code at pub.dev)

On a side note I'm puzzled by @Salakar saying "You shouldn't be adding the Firebase pods to your Podfile, they're automatically added transitively through each FlutterFire plugin." Maybe google documentation hasn't been updated because I can still find documentation there that says, for example, to "Add the dependency for Firebase Authentication to your project's Podfile", and when adding an iOS app in Firebase the procedure shown is still to import the Firebase SDK in AppDelegate. Have these instructions changed?

@vercorro
Copy link

vercorro commented Aug 25, 2020

Adding the following pods in ios/Podfile fixed the issue for me. Are they required? because they are not mentioned in the flutterfire docs.

Thank you @andrsdev ,Adding the dependencies in Podfile solved my issue.

my podfile :

`# Uncomment this line to define a global platform for your project
platform :ios, '10.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  generated_key_values = {}
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) do |line|
    next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
    plugin = line.split(pattern=separator)
    if plugin.length == 2
      podname = plugin[0].strip()
      path = plugin[1].strip()
      podpath = File.expand_path("#{path}", file_abs_path)
      generated_key_values[podname] = podpath
    else
      puts "Invalid plugin specification: #{line}"
    end
  end
  generated_key_values
end

target 'Runner' do
  use_frameworks!
  use_modular_headers!
  
  # Flutter Pod

  copied_flutter_dir = File.join(__dir__, 'Flutter')
  copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
  copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
  unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
    # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
    # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
    # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.

    generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
    unless File.exist?(generated_xcode_build_settings_path)
      raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
    end
    generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
    cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];

    unless File.exist?(copied_framework_path)
      FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
    end
    unless File.exist?(copied_podspec_path)
      FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
    end
  end

  # Keep pod path relative so it can be checked into Podfile.lock.
  pod 'Flutter', :path => 'Flutter'

  # Plugin Pods

  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.each do |name, path|
    symlink = File.join('.symlinks', 'plugins', name)
    File.symlink(path, symlink)
      if name == 'flutter_ffmpeg'
          pod name+'/min-gpl-lts', :path => File.join(symlink, 'ios')
      else
          pod name, :path => File.join(symlink, 'ios')
      end
  end
end

# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
  #End

  use_frameworks!
  use_modular_headers!

#  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
#end



# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

@hyiip
Copy link

hyiip commented Aug 25, 2020

@andrsdev did you have any progress on the related TOActivityCroppedImageProvider.h issue ? As it actually still kills my build in AppCenter.

I got that issue when I used flutter_image_cropper. Then I forked the flutter_image_cropper with an older version (v1.2.3), change the following line of ios/image_cropper.podspec
s.dependency 'TOCropViewController', '~2.5.2'
to
s.dependency 'TOCropViewController', '2.5.2'

then go back to your flutter's pubspec.yaml, and use git dependency

@wiseminds
Copy link

downgrading all firebase plugins to build before August 17 worked form me.

@Salakar Salakar pinned this issue Aug 25, 2020
@Salakar
Copy link
Member

Salakar commented Aug 25, 2020

Would someone be able to provide me a repo that I can clone that reproduces this, then I can take a proper look. I tried to reproduce this myself (#3272 (comment)) but everything worked as expected 🙈

@Salakar Salakar changed the title [firebase_core] fatal error: could not build module 'firebase_core' iOS [firebase_core] iOS could not build module 'firebase_core' Aug 25, 2020
@andrsdev
Copy link
Author

andrsdev commented Aug 25, 2020

@Salakar Have you tried creating a new flutter project downgrading flutter version to 1.17.5 or v1.12.13+hotfix.9? That could be the key to reproduce this issue, since most of current apps were created with older flutter versions.

UPDATE:
I couldn't reproduce the issue creating a new flutter project with flutter version 1.17.5

UPDATE 2
In the project where I had this issue I removed the firebase pods from ios/Podfile and switched to flutter 1.20.2. Surprisingly the app is compiling with no errors. (at the moment of the issue I was using flutter 1.20.1)

@fogelfish
Copy link

To test the proposition that pods are added transitively, as mentioned by Salakar, I removed pod 'Firebase/Core' and pod 'Firebase/Analytics' from the Podfile; removed import Firebase and removed FirebaseApp.configure() from AppDelegate.swift; and kept the firebase_core: ^0.5.0 dependency intact in pubspec.yaml. This is using the example code for firebase_core taken from pub.dev.

With all those iOS-specific imports removed, it builds successfully in Xcode! When I build the iOS project in IntelliJ, it does not work and shows this output:

Xcode's output:
↳
<module-includes>:1:1: error: umbrella header for module 'GoogleUtilities' does not include header 'GULLoggerCodes.h' [-Werror,-Wincomplete-umbrella]
#import "Headers/GoogleUtilities-umbrella.h"
^
<module-includes>:1:1: error: umbrella header for module 'GoogleUtilities' does not include header 'GULNSData+zlib.h' [-Werror,-Wincomplete-umbrella]
2 errors generated.
In file included from /Users/brianfogel/Sites/firebase_core_example/ios/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m:24:
/Users/brianfogel/Sites/firebase_core_example/ios/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Logger/Private/GULLogger.h:22:9: fatal error: could not build module 'GoogleUtilities'
#import <GoogleUtilities/GULLoggerLevel.h>
 ~~~~~~~^
3 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

(I'm using Flutter Channel stable, 1.20.2 and Dart version 2.9.1.)

@acoutts
Copy link

acoutts commented Aug 27, 2020

Just wanted to say I had this exact error and I fixed it like @Beautylivery said. The crux of it was to move my pod declaration after target 'Runner' do. In my case I am using firebase_ml_vision and that requires me adding a single pod for barcode scanning.

Adjusting my podfile like below fixed the build error for me:

target "Runner" do
  pod "Firebase/MLVisionBarcodeModel"
  
  use_frameworks!
  use_modular_headers!

// ...

@fogelfish
Copy link

fogelfish commented Aug 27, 2020

@acoutts thanks for confirming what works. With the following I was able to build to the iOS emulator from within IntelliJ.

In AppDelegate.swift I removed import Firebase and FirebaseApp.configure().

In the Podfile I put

target 'Runner' do

  pod 'Firebase/Core'
  pod 'Firebase/Analytics'

// ...

@acoutts
Copy link

acoutts commented Aug 27, 2020

@acoutts thanks for confirming what works. With the following I was able to build to the iOS emulator from within IntelliJ.

In AppDelegate.swift I removed import Firebase and FirebaseApp.configure().

In the Podfile I put

flutter_ios_podfile_setup

target 'Runner' do

  pod 'Firebase/Core'
  pod 'Firebase/Analytics'

// ...

With the new federated plugin setup / FirebaseCore, you do not want to add anything to your podfile like that as it is all managed by the plugin(s). You can override specific version numbers like this:
https://firebase.flutter.dev/docs/overview#overriding-native-sdk-versions

In my case I have added MLVisionBarcodeModel because that's a separate lib which still requires that step.

@andrsdev
Copy link
Author

Just wanted to say I had this exact error and I fixed it like @Beautylivery said. The crux of it was to move my pod declaration after target 'Runner' do. In my case I am using firebase_ml_vision and that requires me adding a single pod for barcode scanning.

Adjusting my podfile like below fixed the build error for me:

target "Runner" do
  pod "Firebase/MLVisionBarcodeModel"
  
  use_frameworks!
  use_modular_headers!

// ...

@acoutts You are right! I think we can close this issue, but it would be helpful to update firebase_ml_vision documentation to clearly state that those pods must be added like that.

@fogelfish
Copy link

If I leave these out of the podfile, the build fails:

  pod 'Firebase/Core'
  pod 'Firebase/Analytics'

This isn't consistent with the instructions here to not add anything to the podfile.

@andrsdev
Copy link
Author

@fogelfish are you using firebase_ml_vision? or adding other pods (not firebase related) to the podfile?

@acoutts
Copy link

acoutts commented Aug 27, 2020

Also try a pod update and make sure your pods are up to date.

@fogelfish
Copy link

I recreated the project from scratch and I can now verify that there is no need to add the FlutterFire pods to AppDelegate.swift or the Podfile. I've been simply working with the example code at pub.dev for firebase_core, unchanged by me and no other pods involved.

@hajimetakase
Copy link

hajimetakase commented Sep 7, 2020

@acoutts
Your way solved my problem as well.
So do you have any idea why this old way has become inappropriate?
https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_ml_vision/example/ios/Podfile#L68

By the way, the problem I faced while building was "The 'Pods-Runner' target has transitive dependencies that include static frameworks" and while it didn't mentioned firebase, upgrading it with fixed Podfile solved it.

@franagu
Copy link

franagu commented Sep 8, 2020

Thanks @andrsdev your solution worked for me!

@philipvu30
Copy link

Hi guys,

I don't use any methods above. But these steps fixed the issue for me. Hope they will help you too.

  1. Replace the firebase packages to the latest versions.

firebase_database: ^4.0.0
firebase_messaging: ^7.0.0
firebase_analytics: ^6.0.0
firebase_core: ^0.5.0
firebase_auth: ^0.18.0+1

  1. Remove ios/Pods folder.
  2. Remove Podfile and Podfile.lock
  3. Remove pubspec.lock
  4. Open terminal and run these commands one after another
    pod cache clean —all
    flutter clean
    flutter pub get
    pod install

@tinkoffsv
Copy link

Hi guys,

I don't use any methods above. But these steps fixed the issue for me. Hope they will help you too.

  1. Replace the firebase packages to the latest versions.

firebase_database: ^4.0.0
firebase_messaging: ^7.0.0
firebase_analytics: ^6.0.0
firebase_core: ^0.5.0
firebase_auth: ^0.18.0+1

  1. Remove ios/Pods folder.
  2. Remove Podfile and Podfile.lock
  3. Remove pubspec.lock
  4. Open terminal and run these commands one after another
    pod cache clean —all
    flutter clean
    flutter pub get
    pod install

This helped me

@firebase firebase locked and limited conversation to collaborators Sep 27, 2020
@markusaksli-nc markusaksli-nc unpinned this issue Aug 17, 2021
@markusaksli-nc markusaksli-nc pinned this issue Aug 17, 2021
@Salakar Salakar unpinned this issue Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: core resolution: needs-repro This issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin.
Projects
None yet
Development

No branches or pull requests