Flutter
のデバッグ作業中、アプリ起動時にFirebaseAuth.instance.currentUser
の部分でNull check operator used on a null value
のエラーが出てどうにもいかなかった時の対処法です。flutterfire_cli
でflutterfire configure
を試したり、XCode
のキャッシュを削除したりする前に、
-
firebase login
で確認してもuser
の確認が取れている。 - デバッグのシュミレータでなく実機での検証は成功する。
- 周りでは動いていてコードには問題がなく、アプリケーション内部のクラッシュと判断できる。
上記に該当するのであればまず、試して頂きたいのが。
Simulator
->Device
->erase all content and settings...
でシュミレーター上の全ての設定/コンテンツを消去してリセットしてみましょう。