📱Mobile/오류해결

[React Native] Error: No Firebase App '[DEFAULT]' has been created - call firebase.initializeApp()

뉴발자 2025. 3. 12.
728x90

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[React Native] Error: No Firebase App '[DEFAULT]' has been created - call firebase.initializeApp()

 

 

에러 상황

iOS에서 React Native 앱 빌드 후 아래와 같은 오류 메시지가 출력됐다.

 

에러 코드

Error: No Firebase App '[DEFAULT]' has been created - call firebase.initializeApp()

 

 

해결 방법

프로젝트에서 Firebase 라이브러리를 사용하는데 해당 라이브러리가 초기화되지 않아서 발생한 오류였다.

 

AppDelegate.swift 파일에 아래 코드를 추가한 후 정상적으로 동작됐다.

// 의존성 추가
import FirebaseCore

@main
class AppDelegate: RCTAppDelegate {
  override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    ...

    // Firebase 초기화 코드 추가
    FirebaseApp.configure()

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
  
  ...
}

 

 

 

 

 

 

 

 

 

 

728x90

댓글