Error when debugging code - After flutter update - I have provided the pubspec.yaml below. Tried doing flutter clean and flutter pun cache repair. I suspect it has to do with the dependencies/packages, as I've seen a lot of people complaining about the latest update and dependencies not being combatable. Please help me out clear this.
[ +48 ms] FAILURE: Build failed with an exception.
[ +1 ms] * Where:
[ ] Script 'D:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991
[ ] * What went wrong:
[ ] Execution failed for task ':app:compileFlutterBuildDebug'.
[ ] > Process 'command 'D:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
[ ] * Try:
[ ] 21 actionable tasks: 20 executed, 1 up-to-date
[ ] 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 19s
Here is the pubspecc.yaml file -
name: patient_app
description: Grapes IDMR
publish_to: none
# 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.1.2+19
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
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
shared_preferences: ^0.5.1+2 # => Local storage (small files)
package_info: ^0.4.0+16 # => Package information (App name..)
auto_size_text: ^2.1.0 # => Flutter widget that automatically resize text to fit perfectly within its bounds.
introduction_screen: ^1.0.7 # => On boarding Screens slider
fluttertoast: ^3.1.3 # => Toast messages
progress_dialog: ^1.2.0 # => progress Dialogs
http: ^0.12.0+2 # => for http calls
sqflite: ^1.0.0 # => Local storage (Large files)
path_provider: ^1.1.1 # => plugin for finding commonly used locations on the filesystems.
# ext_storage: ^1.0.3 # to get external storage directory
unique_identifier: ^0.0.3 # => For get unique-ID
image_picker: ^0.6.7+2 # image picker in profile screen
image_cropper: ^1.1.0 # crop image in profile screen
recase: ^2.0.1 # convert string case
url_launcher: 5.0.2 # launch url in browser
launch_review: ^2.0.0 # Play store/App store link
intl: ^0.16.0 # for locale, datetime format
razorpay_flutter: ^1.2.3
flutter_html: ^0.11.1 # To display html text as page
flutter_email_sender: ^2.2.2 # for sending email
keyboard_visibility: ^0.5.6
table_calendar: ^2.0.1 # slidable calendar in appointment
# speech_to_text: ^0.7.2 # used in clinical notes entry
flutter_local_notifications: ^1.4.4+1
date_format: ^1.0.8
angles: ^1.2.1 # for tic animation
firebase_messaging: ^7.0.3
share_extend: # for share a file(via social media)
flutter_html_to_pdf: ^0.5.2 # for pdf export
audioplayers: ^0.15.1 # for tic sound
firebase_dynamic_links: ^0.5.0+11
file_picker: ^1.5.1 #^1.13.0+1 #^1.9.0+1 # to select file from memory
photo_view: ^0.9.2 #preview image
dio: ^3.0.9 #http functions delete
mime_type: ^0.3.1 #UPLOAD FILE
open_file: ^3.0.1
simple_permissions:
git:
url: https://github.com/tq-systems/simple_permissions.git
# image: any #create image thumbnail
signalr_client: ^0.1.6 # signalr support
logging: ^0.11.3+2
w3c_event_source: ^1.0.0
rxdart : ^0.24.1
location: ^3.0.0
overlay_support: ^1.0.4 # for notification over screen
audio_recorder: ^1.0.2
proximity_plugin: ^1.0.2
# lazy_load_scrollview: ^1.1.0 #chat list
# audioplayer: ^0.8.1
# audioplayer_web: 0.7.1
app_settings: 4.0.2
flutter_mailer: ^0.4.1+1
advance_pdf_viewer: ^1.2.0
video_player: ^1.0.1
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
assets:
- assets/images/
- assets/images/error_icons/
- assets/images/appointment/
- assets/audio/
fonts:
# - family: NotoEmoji
# fonts:
# - asset: assets/fonts/NotoColorEmoji.ttf
# weight: 400
# - family: Metropolis
# fonts:
# - asset: assets/fonts/Metropolis-Black.ttf
# weight: 900
# - asset: assets/fonts/Metropolis-ExtraBold.ttf
# weight: 800
# - asset: assets/fonts/Metropolis-Bold.ttf
# weight: 700
# - asset: assets/fonts/Metropolis-SemiBold.ttf
# weight: 600
# - asset: assets/fonts/Metropolis-Medium.ttf
# weight: 500
# - asset: assets/fonts/Metropolis-Regular.ttf
# weight: 400
# - asset: assets/fonts/Metropolis-Light.ttf
# weight: 300
# - asset: assets/fonts/Metropolis-ExtraLight.ttf
# weight: 200
# - asset: assets/fonts/Metropolis-Thin.ttf
# weight: 100
# - family: RobotoRegular
# fonts:
# - asset: assets/fonts/Roboto-Regular.ttf
- family: SourceCodePro
fonts:
- asset: assets/fonts/SourceCodePro-Black.ttf
weight: 900
- asset: assets/fonts/SourceCodePro-Bold.ttf
weight: 700
- asset: assets/fonts/SourceCodePro-Semibold.ttf
weight: 600
- asset: assets/fonts/SourceCodePro-Medium.ttf
weight: 500
- asset: assets/fonts/SourceCodePro-Regular.ttf
weight: 400
- asset: assets/fonts/SourceCodePro-Light.ttf
weight: 300
- asset: assets/fonts/SourceCodePro-ExtraLight.ttf
weight: 200
# - family: AppIcons
# fonts:
# - asset: assets/fonts/AppIcons.ttf
# weight: 600
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# 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: 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
Thanks in advance.
Solution 1: Aloysius Samuel
There are some problems with the latest update of Flutter. I have also faced some problems. This is what I did to resolve.
If you are running your flutter project in the
stable
channel, then I would recommend using either thebeta
or themaster
channel. To change your flutter channel open your terminal and write:flutter channel beta
ORflutter channel master
. Then runflutter clean
andflutter run
.If the above method also doesn't work then you should definitely work with some older version of the flutter. Simply write downgrade your flutter by writing
flutter downgrade
in your terminal.