1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter on iOS: redefinition of module 'Firebase'

Discussão em 'Mobile' iniciado por Stack, Outubro 3, 2024 às 10:22.

  1. Stack

    Stack Membro Participativo

    I've been trying to build my flutter app on iOS but flutter run is throwing the following error:

    /Users/<MyUser>/Desktop/projects/app/ios/Pods/Firebase/CoreOnly/Source
    s/module.modulemap:1:8: error: redefinition of module 'Firebase'
    module Firebase {
    ^
    /Users/<MyUser>/Library/Developer/Xcode/DerivedData/Runner-dbkgurnsasbvieahfnk
    dontejqss/SourcePackages/checkouts/firebase-ios-sdk/CoreOnly/Sources/module.
    modulemap:1:8: note: previously defined here
    module Firebase {


    I've imported the firebase-ios-sdk as per the instructions here. The imported modules are FirebaseCore, FirebaseAuth and FirebaseMessaging. I have not made any modifications to iOS-specific code (anything under /ios) apart from importing Firebase in the AppDelegate.swift file. The updated file now contains the following code:

    import UIKit
    import Flutter
    import Firebase

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


    After searching the error I've tried the following steps:

    • flutter clean
    • pod deintegrate and pod install
    • Cleaning DerivedData (both through XCode and manually)
    • Remove and re-add firebase-ios-sdk

    But to no avail.

    Continue reading...

Compartilhe esta Página