0

Before include firebase package i was run the app using flutter run cmd, it's run 100% prefect. but after include firebase package then i was try to run the application it's not working, it's showing like below error.

https://prnt.sc/125ej3l

/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

This is my firebase packages

firebase_core: "0.7.0"
cloud_firestore: "^0.16.0+1"
firebase_auth: "^0.20.1"
shared_preferences: ^0.5.12+4
Jofre
  • 3,718
  • 1
  • 23
  • 31
RVK
  • 53
  • 1
  • 5
  • Try update the packages to the latest version, delete the pubspec.lock and run flutter clean. – Jorge Vieira Apr 27 '21 at 14:50
  • [Please do not post images of code, data, error messages, etc.](https://stackoverflow.com/help/how-to-ask#:~:text=DO%20NOT%20post%20images%20of%20code%2C%20data%2C%20error%20messages%2C%20etc.) – Jofre May 28 '21 at 07:30
  • Does this answer your question? [Finished with error: Gradle task assembleDebug failed with exit code 1](https://stackoverflow.com/questions/54510465/finished-with-error-gradle-task-assembledebug-failed-with-exit-code-1) – JMA May 28 '21 at 08:43

0 Answers0