0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Flutter x Firebase Auth】電話番号認証時にFlutterアプリ(iOS)がクラッシュする

Posted at

環境

  • Flutter: 3.24.3
  • Dart: 3.5.3
  • firebase_core: 3.6.0
  • firebase_auth: 5.3.1
  • Xcode: 16.0

エラーの内容

電話番号認証を行おうとすると Flutter アプリがクラッシュした。
デバッグコンソールには以下のエラーメッセージが出力されていた。

Launching lib/main.dart on iPhone 16 Pro in debug mode...
Xcode build done.                                           23.5s
...略...
FirebaseAuth/PhoneAuthProvider.swift:484: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
Lost connection to device.

Exited.

解決策

こちらを参考に、以下を ios/Runner/Info.plist に追記することで解決しました

<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleTypeRole</key>
		<string>Editor</string>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>ここにREVERSED_CLIENT_IDを入力する</string>
		</array>
    </dict>
</array>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?