Skip to content

FirebaseAuth - Can't catch any exception (in VS Code) #17349

@jeroen-meijer

Description

@jeroen-meijer

Steps to Reproduce

I have a new Firebase project and have active email and password login and imported the Google Services plist file.
I currently have no users in my project. When using this piece of code:
FirebaseAuth.instance.signInWithEmailAndPassword(email: "doesntmatter@gmail.com", password: "doesntmattereither")
it gives me a PlatformException saying the user doesn't exist, which is to be expected, since I have no users.
However, when wrapping a try {FirebaseAuth...either");} catch (e) {...} around it, it doesn't catch the exception, but the app halts (as if there is no try-catch block). Using try {FirebaseAuth...either");} on PlatformException catch (e) {...} or FirebaseAuth...either")..catchError((e) {...}); doesn't work either.

Note: this only happens when running the app with the VS Code debugger. Not when I run the application using flutter run.

Logs

image

Run it ...
image

My log
image

> flutter doctor -v
[✓] Flutter (Channel master, v0.3.7-pre.9, on Mac OS X 10.13.4 17E202, locale nl-NL)
    • Flutter version 0.3.7-pre.9 at /Users/jeroen/Development/flutter
    • Framework revision b2b4665926 (3 days ago), 2018-05-04 18:17:35 -0700
    • Engine revision e976be13c5
    • Dart version 2.0.0-dev.53.0.flutter-e6d7d67f4b

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).
      If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3, Build version 9E145
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.0

[✗] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).

[✓] VS Code (version 1.23.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Dart Code extension version 2.12.1

[✓] Connected devices (2 available)
    • iPhone van Jeroen Meijer • 0a6b212cab22ad19207521c159c5d8e305fe1e52 • ios • iOS 11.3
    • iPhone 8                 • 38C0189D-6290-4431-825F-5082907C7183     • ios • iOS 11.3 (simulator)

! Doctor found issues in 2 categories.


> flutter analyze
Analyzing /Users/jeroen/Projects/_temp/hsb...
  error • The constructor returns type 'dynamic' that isn't of expected type 'Widget' at test/widget_test.dart:15:29 • strong_mode_invalid_cast_new_expr
  error • Undefined class 'MyApp' at test/widget_test.dart:15:33 • undefined_class
  hint • Unused import: 'package:scoped_model/scoped_model.dart' at lib/main.dart:3:8 • unused_import
  hint • Unused import: 'dart:async' at lib/pages/auth_page.dart:4:8 • unused_import
  hint • Unused import: 'package:hsb/main.dart' at test/widget_test.dart:10:8 • unused_import
5 issues found.
(Ran in 4.8s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions