LoginSignup
2
0

Android アプリで Firebase ネットワークタイムアウトエラー:A network error (such as timeout, interrupted connection or unreachable host) has occurred.

Last updated at Posted at 2024-04-20

これなに

Flutter でアプリ実装したけど、Android でネットワークタイムアウトエラーになってしまう事象に遭遇したので調べた

E/RecaptchaCallWrapper(25265): Initial task failed for action RecaptchaAction(action=signUpPassword)with exception - A network error (such as timeout, interrupted connection or unreachable host) has occurred.

エラー内容全文

なんかよくわからないけどネットワークがタイムアウトしたらしい。

I/FirebaseAuth(25265): Creating user with hoge@hoge.com with empty reCAPTCHA token
W/System  (25265): Ignoring header X-Firebase-Locale because its value was null.
D/EGL_emulation(25265): app_time_stats: avg=25.98ms min=9.95ms max=389.89ms count=39
E/RecaptchaCallWrapper(25265): Initial task failed for action RecaptchaAction(action=signUpPassword)with exception - A network error (such as timeout, interrupted connection or unreachable host) has occurred.
I/flutter (25265): *** registerUserInFirebase > Result: [firebase_auth/network-request-failed] A network error (such as timeout, interrupted connection or unreachable host) has occurred.

解決方法

android/app/src/main/AndroidManifest.xml で以下のようにインターネット接続を許可する。

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- ↓ Allow to exchange via the internet -->
    <uses-permission android:name="android.permission.INTERNET" />
    <!-- ↑ Allow to exchange via the internet -->

別の理由もある

Android エミュレーターとかデバイスのネットワーク接続状態も確認しましょう。
実はそっちが繋がってなかったら通信できなくて当たり前なので。

2
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
2
0