Firebase 颤振:异常:Gradle任务assembleDebug失败,退出代码为1

Firebase 颤振:异常:Gradle任务assembleDebug失败,退出代码为1,firebase,flutter,dart,firebase-realtime-database,google-cloud-firestore,Firebase,Flutter,Dart,Firebase Realtime Database,Google Cloud Firestore,在包含firebase软件包之前,我使用flatter run cmd运行应用程序,它运行100%完美。但在包含firebase包之后,我尝试运行应用程序,但它不工作,它显示如下错误 尝试将包更新到最新版本,删除pubspec.lock并运行flutter clean。这是否回答了您的问题? /E:/flutter/flutter_setup/flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/delegate_w

在包含firebase软件包之前,我使用flatter run cmd运行应用程序,它运行100%完美。但在包含firebase包之后,我尝试运行应用程序,但它不工作,它显示如下错误


尝试将包更新到最新版本,删除pubspec.lock并运行flutter clean。这是否回答了您的问题?
/E:/flutter/flutter_setup/flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/delegate_widget.dart:194:18: Error: Superclass has no method named 'inheritFromElement'.
    return super.inheritFromElement(ancestor, aspect: aspect);
                 ^^^^^^^^^^^^^^^^^^
/E:/flutter/flutter_setup/flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:259:19: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/E:/flutter/flutter_setup/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
        ? context.inheritFromWidgetOfExactType(type) as InheritedProvider<T>
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/E:/flutter/flutter_setup/flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:260:19: Error: The method 'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/E:/flutter/flutter_setup/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'ancestorInheritedElementForWidgetOfExactType'.
        : context.ancestorInheritedElementForWidgetOfExactType(type)?.widget
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^          
                                                                        

FAILURE: Build failed with an exception.

* Where:
Script 'E:\flutter\flutter_setup\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'E:\flutter\flutter_setup\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 1m 31s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        93.5s
Exception: Gradle task assembleDebug failed with exit code 1
firebase_core: "0.7.0"
cloud_firestore: "^0.16.0+1"
firebase_auth: "^0.20.1"
shared_preferences: ^0.5.12+4