Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running the flutter app #84689

Closed
spidervirus opened this issue Jun 16, 2021 · 4 comments
Closed

Error while running the flutter app #84689

spidervirus opened this issue Jun 16, 2021 · 4 comments
Labels
r: invalid Issue is closed as not valid

Comments

@spidervirus
Copy link

spidervirus commented Jun 16, 2021

I have error while running the flutter app

Debug Console :
``Launching lib\main.dart on Android SDK built for x86 in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/notifier-1.0.2/lib/notifier_provider.dart:16:21: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.

  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../Documents/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'.
    return (context.inheritFromWidgetOfExactType(NotifierProvider)

                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    

../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_google_places-0.2.6/lib/src/flutter_google_places.dart:74:41: Error: Method not found: 'TypeMatcher'.
context.ancestorStateOfType(const TypeMatcher());
^^^^^^^^^^^
../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_google_places-0.2.6/lib/src/flutter_google_places.dart:74:15: Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.

  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../Documents/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'ancestorStateOfType'.
    context.ancestorStateOfType(const TypeMatcher());
    ^^^^^^^^^^^^^^^^^^^

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\Users\acer\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

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

Process 'command 'C:\Users\acer\Documents\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 26s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm) ``

pubspec.yaml :
``name: product
description: A new Flutter project.

The following defines the version and build number for your application.

A version number is three numbers separated by dots, like 1.2.43

followed by an optional build number separated by a +.

Both the version and the builder number may be overridden in flutter

build by specifying --build-name and --build-number, respectively.

In Android, build-name is used as versionName while build-number used as versionCode.

Read more about Android versioning at https://developer.android.com/studio/publish/versioning

In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.

Read more about iOS versioning at

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

version: 1.0.1+1

environment:
sdk: ">=2.3.0 <3.0.0"

sdk: ">=2.2.2 <3.0.0"

dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter

The following adds the Cupertino Icons font to your application.

Use with the CupertinoIcons class for iOS style icons.

cupertino_icons: ^0.1.2
location: 3.0.1
google_maps_flutter: 0.5.31
geocoder: ^0.2.1
smooth_star_rating: ^1.0.3
flutter_speed_dial: ^1.2.1
stripe_payment: ^1.0.7
shared_preferences: 0.5.4+5
rxdart: 0.24.1
http: ^0.12.0+1
firebase_auth: 0.14.0+9
auto_size_text: 2.1.0
google_maps_webservice: ^0.0.14
flutter_google_places: ^0.2.3
geolocator: ^5.0.0
braintree_payment: 1.2.4
transformer_page_view: 0.1.6
url_launcher: 5.4.10
firebase_messaging: ^5.0.4
notifier: 1.0.2
fluttertoast: 4.0.1
carousel_slider: 2.2.1
flutter_polyline_points: ^0.1.0
firebase_admob: 0.9.3+2
razorpay_flutter: 1.2.2
flutter_local_notifications: 1.4.4+4
sms_otp_auto_verify:
progressive_image:

rflutter_alert:

dev_dependencies:
flutter_test:
sdk: flutter

For information on the generic Dart part of this file, see the

following page: https://dart.dev/tools/pub/pubspec

The following section is specific to Flutter.

flutter:

The following line ensures that the Material Icons font is

included with your application, so that you can use the icons in

the material Icons class.

uses-material-design: true

To add assets to your application, add an assets section, like this:

assets:

  • Assets/imgLogo.png
  • Assets/FoodZoneLogo.png
  • Assets/googlePlus.png
  • Assets/facebook.png
  • Assets/Dashboard/biryani.jpeg
  • Assets/Dashboard/googleMap.png
  • Assets/RestaurantDetails/RestaurantApp.jpg
  • Assets/RestaurantDetails/profileImage.jpg
  • Assets/RestaurantDetails/vegFood.jpg
  • Assets/RestaurantDetails/veg.png
  • Assets/RestaurantDetails/nonVeg.png
  • Assets/res.jpeg
  • Assets/food.jpeg
  • Assets/jacMa.jpg
  • Assets/nonVeg.png
  • Assets/offer.png
  • Assets/map.png
  • Assets/Checkout/success.png
  • Assets/Checkout/razorpay.png
  • Assets/Payment/Card.png
  • Assets/Payment/Cod.png
  • Assets/Payment/paypal.png
  • Assets/Payment/coffee.png
  • Assets/images/chef.png
  • Assets/images/BegingPrepared.jpg
  • Assets/images/Ober.png
  • Assets/images/lockedAccess.png
  • Assets/images/foodTruck.png
  • Assets/Language/localization_en.json
  • Assets/Language/localization_fr.json
  • Assets/Language/localization_ar.json
  • Assets/Cart/emptyCart.png
  • Assets/images/dataNotFound.png
  • Assets/images/bell.png
  • Assets/images/mail.png
  • Assets/error.png
  • Assets/Onboarding/ob1.png
  • Assets/Onboarding/ob2.png
  • Assets/Onboarding/ob3.png
  • Assets/Onboarding/ob4.png
  • Assets/flags/brazil.png
  • Assets/flags/canada.png
  • Assets/flags/spain.png
  • Assets/flags/uae.png
  • Assets/flags/usa.png
  • Assets/changePassword/passwordSuccess.png
  • Assets/TrackOrder/car.png
  • Assets/TrackOrder/destination_map.png
  • Assets/Banner/banner1.png
  • Assets/Banner/banner2.png
  • Assets/Banner/banner3.jpg
  • Assets/loading.gif

emptyCart

An image asset can refer to one or more resolution-specific "variants", see

https://flutter.dev/assets-and-images/#resolution-aware.

For details regarding adding assets from package dependencies, see

https://flutter.dev/assets-and-images/#from-packages

To add custom fonts to your application, add a fonts section here,

in this "flutter" section. Each entry in this list should have a

"family" key with the font family name, and a "fonts" key with a

list giving the asset and other descriptors for the font. For

example:

fonts:
- family: Quicksand
fonts:
- asset: Assets/Font/Quicksand-Bold.ttf
- asset: Assets/Font/Quicksand-Light.ttf
- asset: Assets/Font/Quicksand-Medium.ttf
- asset: Assets/Font/Quicksand-Regular.ttf
weight: 700

fonts:

- family: Schyler

fonts:

- asset: fonts/Schyler-Regular.ttf

- asset: fonts/Schyler-Italic.ttf

      # style: italic

- family: Trajan Pro

fonts:

- asset: fonts/TrajanPro.ttf

- asset: fonts/TrajanPro_Bold.ttf

weight: 700

For details regarding fonts from package dependencies,

see https://flutter.dev/custom-fonts/#from-packages

``
Please kindly look into the matter and please try to help me out

@asashour
Copy link
Contributor

Could you edit your question and format the logs into something like the below (Insert Code, or use ``` before and after it).

Also, please send a minimal code example of the application and the output of flutter doctor -v

some logs

@spidervirus
Copy link
Author

Minimal code example of application means ?

[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
• Flutter version 2.2.2 at C:\Users\acer\Documents\flutter
• Framework revision d79295a (5 days ago), 2021-06-11 08:56:01 -0700
• Engine revision 91c9fc8fe0
• Dart version 2.13.3

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\acer\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)

[√] IntelliJ IDEA Ultimate Edition (version 2021.1)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2021.1.2
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.57.0)
• VS Code at C:\Users\acer\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.23.0

[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.106
• Edge (web) • edge • web-javascript • Microsoft Edge 91.0.864.48

• No issues found!

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Jun 16, 2021
@darshankawar
Copy link
Member

@spidervirus
Since you are on stable 2.2.2, it supports null safety by default, so all the third party plugins you are using need to be upgraded to respective latest versions. I see the errors are pointing to notifier and flutter_google_places which need to be upgraded to latest. If any of your plugins don't support null safety, you need to use --no-sound-null-safety flag to run your app.

Closing from here, as this isn't an issue.

@darshankawar darshankawar added r: invalid Issue is closed as not valid and removed in triage Presently being triaged by the triage team labels Jun 16, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: invalid Issue is closed as not valid
Projects
None yet
Development

No branches or pull requests

3 participants