异常:Gradle 任务 assembleDebug 失败,退出代码为 -1。扑
Exception: Gradle task assembleDebug failed with exit code -1. flutter
我正在尝试 运行 我的 flutter 项目,但我收到此错误日志:
/D:/applications/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/utils/exception.dart:12:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
Never convertPlatformException(Object exception, StackTrace stackTrace) {
^
3
FAILURE: Build failed with an exception.
* Where:
Script 'D:\applications\Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\applications\Flutter\flutter\bin\flutter.bat'' 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 34s
Exception: Gradle task assembleDebug failed with exit code 1
这是 flutter doctor 的输出:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19042.1526], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Android Studio
[√] VS Code
[√] Connected device (3 available)
注意:我将包名称从默认更改为我需要的名称,如果这可能有助于找到错误!
这可能是由于您将旧版本的 Flutter 与相对较新版本的软件包结合使用造成的。您可以尝试更新 Dart/Flutter 版本,这可能会解决您的问题:
https://docs.flutter.dev/development/tools/sdk/upgrading
尝试
颤动干净
发布获取
然后重启应用
我重读了你的错误,在我看来,你从 firestore 中得到了 null
我正在尝试 运行 我的 flutter 项目,但我收到此错误日志:
/D:/applications/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/utils/exception.dart:12:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
Never convertPlatformException(Object exception, StackTrace stackTrace) {
^
3
FAILURE: Build failed with an exception.
* Where:
Script 'D:\applications\Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\applications\Flutter\flutter\bin\flutter.bat'' 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 34s
Exception: Gradle task assembleDebug failed with exit code 1
这是 flutter doctor 的输出:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19042.1526], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Android Studio
[√] VS Code
[√] Connected device (3 available)
注意:我将包名称从默认更改为我需要的名称,如果这可能有助于找到错误!
这可能是由于您将旧版本的 Flutter 与相对较新版本的软件包结合使用造成的。您可以尝试更新 Dart/Flutter 版本,这可能会解决您的问题: https://docs.flutter.dev/development/tools/sdk/upgrading
尝试
颤动干净
发布获取 然后重启应用
我重读了你的错误,在我看来,你从 firestore 中得到了 null