'platformexception in firebase auth

Error: The argument type 'Object' can't be assigned to the parameter type 'PlatformException'.

  • 'Object' is from 'dart:core'.
  • 'PlatformException' is from 'package:flutter/src/services/message_codec.dart' ('../../snap/flutter/common/flutter/packages/flutter/lib/src/services/message_codec.dart'). platformExceptionToFirebaseAuthException(exception), ^

FAILURE: Build failed with an exception.

  • Where: Script '/home/e-tech/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1102

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command '/home/e-tech/snap/flutter/common/flutter/bin/flutter'' finished with non-zero exit value 1

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 13s Exception: Gradle task assembleDebug failed with exit code 1



Solution 1:[1]

take a look if you that Object that you want to use is from Firebase package or from Dart, in this case you are using dart:core but there's also firebase_core.

I assume you are using a class upon which it takes an Object as an argument, would be good if i see the code, but if is not working put dynamic instead and then along the way you'll figure out what's the issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marcelo Cesar