firebase auth 中的平台异常
错误:参数类型“Object”无法分配给参数类型“PlatformException”。
- “对象”来自“dart:core”。
- “PlatformException”来自“package:flutter/src/services/message_codec.dart”(“../../snap/flutter/common/flutter/packages/flutter/lib/src/services/message_codec.dart”)。 platformExceptionToFirebaseAuthException(异常), ^
失败:构建因异常而失败。
地点: 脚本'/home/e-tech/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle'行:1102
出了什么问题: 任务“:app:compileFlutterBuildDebug”执行失败。
处理'命令'/home/e-tech/snap/flutter/common/flutter/bin/flutter''以非零退出值1完成
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。
- 获取更多帮助
13 秒内构建失败 异常:Gradle 任务 assembleDebug 失败,退出代码为 1
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: 1102What 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看一下您要使用的对象是否来自 Firebase 包或来自 Dart,在本例中您使用的是 dart:core,但也有 firebase_core。
我假设您正在使用一个以对象作为参数的类,如果我看到代码会很好,但如果不起作用,请使用动态,然后一路上您会找出问题所在。
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.