Error: Could not build Objective-C module 'Firebase' with Swift 5
Asked Answered
J

2

0

I want to use Firebase with Swift 5, but error message appears.

Could not build Objective-C module 'Firebase'

I tried all resolutions on below pages, but I can't solve it:

Error: Could not build Objective-C module 'Firebase'

https://github.com/firebase/quickstart-ios/issues/672

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    FirebaseApp.configure()
    return true
  }
}

I expect Build Success, but actually Build Failed.

Build error messages are:

'FirebaseCore/FirebaseCore.h' file not found Could not build Objective-C module 'Firebase'

And, xcode shows Error message at

import Firebase

in AppDelegate.swift

Jeane answered 7/9, 2019 at 17:37 Comment(0)
J
4

My business partner solves this issue.

The resolution is below steps:

  1. Quite xcode
  2. Delete "ProjectName.xcworkspace", "Podfile.lock" and "Pods".
  3. Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData (Command + Shift + G in finder)
  4. Run "pod install" from terminal.
  5. Open "ProjectName.xcworkspace".
  6. Add "$(inherited)" to "TARGET > Build Settings > Framework Search Paths".
Jeane answered 8/9, 2019 at 15:42 Comment(3)
Searched through other answers and deleting Pods folder was what was missing. Spent few hours trying so thanks. Also, For me I needed to set "Build Active Architecture Only" to "No" as always.Maurili
Not Working for me in Xcode 12.4 . Earlier it was working fine with Xcode 11.Niko
Not working for me as wellLugworm
C
0
  1. Pod deintegrate.
  2. Delete xcworkspace file.
  3. Open terminal with Rosetta.
  4. Install pods.
Cortico answered 17/11, 2021 at 19:42 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.