광어네 맛집

[Firebase Error]FirebaseApp.configure() 에러 처리 본문

Swift/My Swift Error

[Firebase Error]FirebaseApp.configure() 에러 처리

Lautner Jacob 2022. 3. 2. 02:05
728x90
반응형

요즘 코로나가 심해져서

어딜가기가 너무 무서운 것 같음

빨리 코로나가 해결됐으면 좋겠음 ㅜㅜ

 

오늘 다룰 에러는!

"The default FirebaseApp instance must be configured before the default Authinstance can be initialized. One way to ensure this is to call 'FirebaseApp.configure()' in the App Delegate's' application(_:didFinishLaunching withOptions:)'(or the '@main' struct's initializer in SwiftUI)."

인스턴스 초기화 해줘라!!

이번 오류가 길다 길어;

 

나는 인스턴스 초기화해줬는데 왜 오류가 떴지 했는데
읽어보니 AppDelegate에서 처리해줘라 였음!

 

그래서 아래처럼 추가 구현해줌!

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

 

아직 끝난게 아님!
이런 오류가 한번 더 뜸

"Default app has already been configured"

이미 있는데? 왜 또 했어!!

 

중복이라고 뜬 걸 보고 SceneDelegate에서 지워주니 해결!!

AppDelegate에서만 구현해주는 걸로 합시다!

 

SceneDelegate는 UI에 관여해서 굳이 구현할 필요가 없다고...ㅎㅎ...

오늘도 화이팅!

728x90
반응형