Skip to content

[firebase_core] ^0.5.0, iOS build errors in minimal firebase_core example from pub.dev #3327

Closed
@fogelfish

Description

@fogelfish

Describe the bug
iOS failure to build main.dart from firebase_core example at pub.dev.
Xcode shows two errors:
Include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin'
Could not build module 'firebase_core'

To Reproduce
Steps to reproduce the behavior:

  1. create, configure and run the example project
  2. Flutter UI fails to load, showing 2 Buildtime errors

Expected behavior
The Flutter UI should load.

Additional context

My pubspec.yaml dependencies:

dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^0.5.0

I created a Firebase project specifically to run this example and added its GoogleService-Info.plist file into Runner in Xcode.

Added this to the Podfile:
pod 'Firebase/Analytics

Here is my AppDelegate.swift file:

import UIKit
import Flutter
import Firebase

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    FirebaseApp.configure()
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

Flutter doctor
(Don't know why Android Studio is listed twice... that's odd.)

[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G2021, locale en-US)
    • Flutter version 1.20.2 at /Users/brianfogel/flutter/flutter
    • Framework revision bbfbf1770c (11 days ago), 2020-08-13 08:33:09 -0700
    • Engine revision 9d5b21729f
    • Dart version 2.9.1

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/brianfogel/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/brianfogel/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 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] IntelliJ IDEA Ultimate Edition (version 2020.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 48.1.4
    • Dart plugin version 202.6397.47

[✓] Connected device (1 available)
    • iPhone SE (2nd generation) (mobile) • 33514B68-28B9-4ABB-9469-5AC40956B49C • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)

• No issues found!

IntelliJ 2020.2 error output

Error output from Xcode build:
↳
** BUILD FAILED **

Xcode's output:
↳
While building module 'firebase_core' imported from /Users/brianfogel/Sites/firebase_core_example/ios/Runner/GeneratedPluginRegistrant.m:8:
In file included from <module-includes>:1:
In file included from /Users/brianfogel/Sites/firebase_core_example/build/ios/Debug-iphonesimulator/firebase_core/firebase_core.framework/Headers/firebase_core-umbrella.h:13:
In file included from /Users/brianfogel/Sites/firebase_core_example/build/ios/Debug-iphonesimulator/firebase_core/firebase_core.framework/Headers/FLTFirebaseCorePlugin.h:11:
/Users/brianfogel/Sites/firebase_core_example/build/ios/Debug-iphonesimulator/firebase_core/firebase_core.framework/Headers/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/brianfogel/Sites/firebase_core_example/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
        ^
1 error generated.
/Users/brianfogel/Sites/firebase_core_example/ios/Runner/GeneratedPluginRegistrant.m:8:9: fatal error: could not build module 'firebase_core'
#import <firebase_core/FLTFirebaseCorePlugin.h>
 ~~~~~~~^
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: iosIssues / PRs which are specifically for iOS.resolution: duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions