xcode – Flutter – Firebase iOS App: Construct error: Module ‘firebase_core’ not discovered


I am making a Flutter App with Firebase because the backend (I’ve setup each connections from Android and iOS to Firebase already).
I can construct and run my app on each Android Emulator and actual Android gadget, no downside.
However when I attempt to run my app on an iOS Simulator (have not tried actual iPhone but), construct fails within the file GeneratedPluginRegistrant.h with this error: Module 'firebase_core' not discovered.

Content material of the file GeneratedPluginRegistrant.h:
(if I remark out the road @import cloud_firestore;, it’ll simply throw the identical error on the subsequent such @import)

//
//  Generated file. Don't edit.
//

// clang-format off

#import "GeneratedPluginRegistrant.h"

#if __has_include(<cloud_firestore/FLTFirebaseFirestorePlugin.h>)
#import <cloud_firestore/FLTFirebaseFirestorePlugin.h>
#else
@import cloud_firestore;
#endif

#if __has_include(<firebase_auth/FLTFirebaseAuthPlugin.h>)
#import <firebase_auth/FLTFirebaseAuthPlugin.h>
#else
@import firebase_auth;
#endif

#if __has_include(<firebase_core/FLTFirebaseCorePlugin.h>)
#import <firebase_core/FLTFirebaseCorePlugin.h>
#else
@import firebase_core;
#endif

#if __has_include(<flutter_tts/FlutterTtsPlugin.h>)
#import <flutter_tts/FlutterTtsPlugin.h>
#else
@import flutter_tts;
#endif

#if __has_include(<shared_preferences_ios/FLTSharedPreferencesPlugin.h>)
#import <shared_preferences_ios/FLTSharedPreferencesPlugin.h>
#else
@import shared_preferences_ios;
#endif

@implementation GeneratedPluginRegistrant

+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
  [FLTFirebaseFirestorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseFirestorePlugin"]];
  [FLTFirebaseAuthPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAuthPlugin"]];
  [FLTFirebaseCorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseCorePlugin"]];
  [FlutterTtsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterTtsPlugin"]];
  [FLTSharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTSharedPreferencesPlugin"]];
}

@finish

I just lately opened this flutter mission for the primary time in months, so I needed to replace lots of issues. I’ve up to date all dependencies in pubspec.yaml, upgraded from Flutter 2.?.? to Flutter 3.3.8 and many others.
One vital factor to say is that Firebase now suggests you so as to add the dependencies to the iOS app through the Swift Bundle Supervisor (SPM), as an alternative of pasting code into your Podfile. Might this be the supply of the issue?

That is the content material of my AppDelegate.swift:

import UIKit
import Flutter
import FirebaseCore //firebase

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

I do not know what different data so as to add that can assist you perceive the place the issue could be. In the event you suppose I ought to add one thing, please inform me.

See also  ios - Swift Reminiscence Leaks with UIDiffableDataSource, CFString, Malloc Blocks, and others

Leave a Reply