title: Network error (such as timeout, interrupted connection or unreachable host) has occurred in flutter
body: <p>I'm using flutter, and everything was working fine except today. Now, whenever I try to log in, I get this error: <strong>Network error (such as timeout, interrupted connection or unreachable host) has occurred from FIREBASE on my iOS Simulator.</strong></p>
  
  <p>And this is the error thrown in my console : </p>
  
  <pre><code>Challenge SecTrustResultType 5 for www.googleapis.com, properties: (
          {
            type = error;
            value = "Root certificate is not trusted.";
          }
  )
  Cancelling authentication challenge for https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      "LocalDataTask &lt;59EA3048-54FD-41F4-87FF-4919A55A9E06&gt;.&lt;1&gt;"
  ), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask &lt;59EA3048-54FD-41F4-87FF-4919A55A9E06&gt;.&lt;1&gt;, NSLocalizedDescription=cancelled} [-999]
  </code></pre>
  
  <p>I have tried everything, googled everything but this is very weird. Since the code was working before, but not working on my system. I guess there is some issues with my simulator. <strong>Checked the date of my simulator</strong>, it is fine. </p>
  
  <p>This is my login code : </p>
  
  <pre><code>final AuthCredential credential = EmailAuthProvider.getCredential(email: this.email.text, password: this.password.text);
  this._auth.signInWithCredential(credential).then((user) async {
    this.gotoHome(context);
  }, onError: (e){
       Helpers.showError(context, (e as PlatformException).message);
  });
  </code></pre>
  
  <p><strong>Flutter Doctor Report:</strong></p>
  
  <pre><code>[✓] Flutter (Channel master, v1.5.9-pre.194, on Mac OS X 10.14.5 18F132, locale en-US)
      • Flutter version 1.5.9-pre.194 at /Users/alok/flutter
      • Framework revision 3436e165c8 (6 weeks ago), 2019-05-09 10:37:34 -0700
      • Engine revision 644db5a49c
      • Dart version 2.3.1 (build 2.3.1-dev.0.0 a0290f823c)
  
  
  [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
      • Android SDK at /Users/alok/Library/Android/sdk
      • Android NDK location not configured (optional; useful for native profiling support)
      • Platform android-28, build-tools 28.0.3
      • Java binary at: /Applications/Android
        Studio.app/Contents/jre/jdk/Contents/Home/bin/java
      • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
      • All Android licenses accepted.
  
  [✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
      • Xcode at /Applications/Xcode.app/Contents/Developer
      • Xcode 10.0, Build version 10A255
      • ios-deploy 1.9.4
      • CocoaPods version 1.6.0
  
  [!] Android Studio (version 3.4)
      • Android Studio at /Applications/Android Studio.app/Contents
      ✗ Flutter plugin not installed; this adds Flutter specific functionality.
  Aloks-MacBook-Air:newmonkapp alok$ flutter doctor
  Doctor summary (to see all details, run flutter doctor -v):
  [✓] Flutter (Channel master, v1.5.9-pre.194, on Mac OS X 10.14.5 18F132, locale en-US)
  
  [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
  [✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
  [!] Android Studio (version 3.4)
      ✗ Flutter plugin not installed; this adds Flutter specific functionality.
      ✗ Dart plugin not installed; this adds Dart specific functionality.
  [✓] Connected device (1 available)
  
  ! Doctor found issues in 1 category.
  </code></pre>
  
  <p>Also came across with this error included with the above error: </p>
  
  <blockquote>
    <p> Encounter network error. Code, error: -999, Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=<a href="https://play.googleapis.com/log" rel="nofollow noreferrer">https://play.googleapis.com/log</a>, NSErrorFailingURLKey=<a href="https://play.googleapis.com/log" rel="nofollow noreferrer">https://play.googleapis.com/log</a>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
        "LocalUploadTask .&lt;1>"
    ), _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask .&lt;1>, NSLocalizedDescription=cancelled}
    5.16.0 - [GULNetwork][I-NET901017]  Encounter network error. Code, error: -999, Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=<a href="https://play.googleapis.com/log" rel="nofollow noreferrer">https://play.googleapis.com/log</a>, NSErrorFailingURLKey=<a href="https://play.googleapis.com/log" rel="nofollow noreferrer">https://play.googleapis.com/log</a>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
        "LocalUploadTask .&lt;1>"
    ), _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask .&lt;1>, NSLocalizedDescription=cancelled}
    5.16.0 - [Firebase/Core][I-COR000020] Error posting to Clearcut: Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=<a href="https://play.googleapis.com/log" rel="nofollow noreferrer">https://play.googleapis.com/log</a>, NSErrorFailingURLKey=<a href="https://play.googleapis.com/log" rel="nofollow noreferrer">https://play.googleapis.com/log</a>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
        "LocalUploadTask .&lt;1>"
    ), _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask .&lt;1>, NSLocalizedDescription=cancelled}, with Status Code: 0</p>
  </blockquote>