Firebase Authentication FirebaseNetworkException: A network error (such as timeout, interrupted connection or unreachable host) has occurred

后端 未结 17 1633
感情败类
感情败类 2020-12-06 04:55

I\'m creating an authentication workflow for my android app. I\'m allowing users to sign in with username/password and various OAuth providers. I\'m validating emails and pa

相关标签:
17条回答
  • 2020-12-06 04:59

    In my case the issue is due to mismatch versions of dependencies, then I have changed dependencies like below

    implementation 'com.google.firebase:firebase-auth:+'
    implementation 'com.google.firebase:firebase-core:+'
    implementation 'com.google.android.gms:play-services-auth:+'
    implementation 'com.firebaseui:firebase-ui-auth:+'
    

    then its started working perfectly.

    0 讨论(0)
  • 2020-12-06 05:00
    1. Reason is Simple ! Check if Device has internet connection.
    2. if you have google services enabled
    3. phone time settings
    4. firebase json file is wrong .cant take client id or google app id or api key
    0 讨论(0)
  • 2020-12-06 05:02

    I have faced this problem when geting IdToken from firebase user Object. I did not know what was the real source of error it was just showing FirebaseNetworkException but I also couldn't catch that error so I just used the General Exception Object to catch this Error.

    as follow

    try {
       //your code that is throwing this error
    }catch (Exception e){
       //handle the exception thrown
    }
    
    0 讨论(0)
  • 2020-12-06 05:07

    I had a similar problem accessing firebase. In my case, the problem was that I was doing this on a real device via the debugger. Once I ran the code "normally" the error vanished. So, it might be helpful to check whether the debugger is getting in the way.

    0 讨论(0)
  • 2020-12-06 05:10
    <a (click)="login()" class="nav-link">Login</a>
    

    Do not put href attribute into tag a. It is help to solved my case

    0 讨论(0)
  • 2020-12-06 05:10

    It could be a million things my advice based on my experience is check the firebase logs and work the problem from there.

    In my case I was hitting the endpoint successfully but it was generating a catch error because of an invalid variable rowsCompany on the res.json({...response...} )

    0 讨论(0)
提交回复
热议问题