강의

멘토링

커뮤니티

Inflearn コミュニティ Q&A

imhw19975166 のプロフィール画像
imhw19975166

投稿した質問数

Flutter + FirebaseでNetflix UIクローンをコーディングする[ランダムフラッター]

フラッターとファイアベースの連携 - 2) フラッターコードの作成

firebase 적용후 디버깅시

作成

·

2.1K

0

firebase 를 적용시키고 메뉴얼대로 실행을 하였음에도

======== Exception caught by widgets library =======================================================
The following FirebaseException was thrown building KeyedSubtree-[<0>]:
[core/not-initialized] Firebase has not been correctly initialized.

 

Usually this means you've attempted to use a Firebase service before calling `Firebase.initializeApp`.

 

View the documentation for more information: https://firebase.flutter.dev/docs/overview#initialization

 

The relevant error-causing widget was: 
  TabBarView TabBarView:file:///D:/StudioProjects/netflix_clone/lib/main.dart:34:17

라는 오류명과 함께

와 같은 에러가 발생하고 있습니다 찾아보니 초기화가 안되어 있다고 되어있는데 해결방법은 애초에 firebase 설정할때의 순서대로 하는 방법이 해결법이라고 하더군요.. 아무리 적용을하고 수정을 했음에도 안되는 이유를 아시는 분은 답변 부탁 드리겠습니다.. ㅠㅠ

클론코딩Flutterfirebase

回答 3

1

void main() async {

WidgetsFlutterBinding.ensureInitialized();

await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);

runApp(MyApp());

}

 

저도 같은 오류가 있어 플러터 공식문서를 찾아보니 initializeApp()안에 저 옵션을 넣어줘야 한다고 해서 넣었더니 해결되었습니다.

https://firebase.flutter.dev/docs/ui/auth/integrating-your-first-screen/#initializing-firebase

0

저는 main.dart에 이렇게 수정해서 실행했습니다....

void main() async {
 WidgetsFlutterBinding.ensureInitialized();
 await Firebase.initializeApp();
 runApp(MyApp());
}

0

imhw1997님의 프로필 이미지
imhw1997
質問者

현재

firebase_core: ^1.20.0

cloud_firestore: ^3.4.2 입니다

imhw19975166 のプロフィール画像
imhw19975166

投稿した質問数

質問する