I upgraded flutter and dart recently and unexpectedly encountered this error. Everything was fine, I just re-started the project and the error was there!
Error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
My pubspec.yml dependencies:
dependencies:
auto_animated: any
awesome_dialog: ^2.1.1
cached_network_image: ^3.0.0
carousel_slider: ^3.0.0
circular_countdown_timer: ^0.2.0
cupertino_icons: ^1.0.0
dropdown_search: ^2.0.1
dropdownfield: ^1.0.3
email_validator: ^2.0.1
expandable: ^5.0.1
firebase_core: ^1.10.2
firebase_messaging: ^11.2.0
flutter:
sdk: flutter
flutter_animator: ^3.2.0
flutter_html: ^0.8.2
flutter_launcher_icons: any
flutter_local_notifications: ^6.0.0
flutter_spinkit: ^5.0.0
flutter_tags: ^0.4.9+1
flutter_zoom_drawer: ^2.1.1
google_fonts: any
http: ^0.13.1
image: ^3.0.2
image_picker: ^0.7.4
image_size_getter: ^1.0.0
intl: ^0.17.0
material_design_icons_flutter: 4.0.5955
mime: ^1.0.0
page_transition: ^1.0.9
progress_indicators: ^1.0.0
provider: ^6.0.1
shared_preferences: ^2.0.6
swipe_cards: ^0.1.0
syncfusion_flutter_datepicker: ^19.3.56
textfield_tags: ^1.1.1
upgrader: ^3.3.0
url_launcher: ^6.0.3
webview_flutter: ^0.3.0
path_provider: ^2.0.1
open_file: ^3.1.0
What I've tried:
flutter upgrade
Flutter clean and flutter get
Changing min SDK version
The problem was solved after I reinstalled flutter and created a project from scratch and copied my older code. Also, Firebase is now only compatible if you have the min SDK version of 19.
I solved it by upgrading the AndroidStudio Version,It maybe caused by the low version of development tool,
Related
flutter run works but flutter run --release or flutter run --release --profile returns the error below:
===== CRASH =====
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x0
version=2.18.6 (stable) (Tue Dec 13 21:15:14 2022 +0000) on "macos_simarm64"
pid=14192, thread=-1, isolate_group=isolate(0x7f910c011200), isolate=(nil)(0x0)
isolate_instructions=0, vm_instructions=0
Stack dump aborted because InitialRegisterCheck failed.
Dart snapshot generator failed with exit code -6
Here's my pubspec.yaml dependencies:
version: 1.0.0+1
environment:
sdk: ">=2.15.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_native_splash: ^2.1.6
table_calendar: ^3.0.8
image_stack: ^2.1.1
intl: ^0.17.0
shimmer: ^2.0.0
flutter_riverpod: ^1.0.4
auto_route: ^5.0.4
google_fonts: ^3.0.1
pinput: ^2.2.9
mask_text_input_formatter: ^2.3.0
firebase_core: ^1.21.1
dio: ^4.0.6
dio_cache_interceptor: ^3.2.7
dio_cache_interceptor_hive_store: ^3.1.1
http: ^0.13.5
enum_to_string: ^2.0.1
mobile_scanner: ^2.1.0
firebase_auth: ^3.3.19
image_picker: ^0.8.5+3
image_cropper: ^3.0.1
firebase_storage: ^10.2.18
fluttertoast: ^8.0.9
firebase_messaging: ^13.0.1
hive: ^2.2.1
hive_flutter: ^1.1.0
flutter_hooks: ^0.18.5+1
hooks_riverpod: ^1.0.4
local_auth: ^2.1.0
lottie: ^2.1.0
flutter_local_notifications: ^9.7.0
device_info_plus: ^4.0.1
timeago: ^3.2.2
url_launcher: ^6.1.5
focused_menu: ^1.0.5
rxdart: ^0.27.7
rate_my_app: ^1.1.3
infinite_scroll_pagination: ^3.2.0
flutter_offline: ^2.1.0
webview_flutter: ^4.0.1
shared_preferences: ^2.0.15
web_socket_channel: ^2.2.0
fl_chart: ^0.55.2
dev_dependencies:
#flutter_gen_runner:
auto_route_generator: ^5.0.2
firebase_core_platform_interface: ^4.5.1
build_runner: any
flutter_lints: ^2.0.1
flutter_launcher_icons: ^0.11.0
flutter_test:
sdk: flutter
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icons/b2b_logo.png"
flutter:
uses-material-design: true
generate: true
assets:
- assets/images/
- assets/
- assets/animations/
- assets/icons/
fonts:
- family: SnagIcons
fonts:
- asset: assets/fonts/SnagIcons.ttf</summary>
The application from 2 months ago was building successfully but as of last week, I have been getting this issue and reverting the changes i still get the same issue.
Try to switch to flutter dev channel and back to flutter stable.
Do a flutter clean and flutter pub get and try it again.
This occours because of the some updates in the packages
Try entering the below code in the vs code terminal:
flutter clean
flutter pub get
Your flutter code will work like a charm!
Edit:
There are github issues which address this,see if any works for you
https://github.com/flutter/flutter/issues/43707
https://github.com/flutter/flutter/issues/109818
https://github.com/flutter/flutter/issues/43597
So, after raising the issue on the flutter channel, the problem was caused by returning a late variable from a future method so there was a fix in the release of flutter 3.7 which will remedy this problem
You can view the issue here on GitHub
I receive the following error after adding RXdartto my pubspec.yaml:
Because no versions of cached_network_image match >2.5.1 <3.0.0 and cached_network_image 2.5.1 depends on flutter_cache_manager ^2.1.0, cached_network_image ^2.5.1 requires flutter_cache_manager ^2.1.0.
Packages use:
ev_dependencies:
flutter_test:
sdk: flutter
cached_network_image: ^2.5.1
cloud_firestore: ^1.0.1
dio: ^4.0.0
enum_to_string: ^2.0.1
equatable: ^2.0.0
firebase_analytics: ^7.1.1
firebase_auth: ^1.0.1
firebase_core: ^1.0.1
firebase_storage: ^8.0.0
flutter_bloc: ^7.0.0
geocoding: ^2.0.0
geolocator: ^7.0.1
google_maps_flutter: ^2.0.2
image_cropper: ^1.4.0
image_picker: ^0.7.3
intl: ^0.17.0
material_design_icons_flutter: ^4.0.5955
material_floating_search_bar: ^0.3.3
meta: ^1.3.0
permission_handler: ^6.1.1
rxdart: ^0.26.0
timeago: ^3.0.2
uuid: ^3.0.1
What exactly do the message mean? How can this be solved?
Not that I'm very knowledgeable about the topic. But I had a similar issue and couldn't find anything that solves it.
Nevertheless, it helped me -
remove the line rxdart: ^0.26.0 from the pubspec.yaml file and then in the terminal
flutter pub add rxdart
flutter pub upgrade rxdart
As far as I know after these changes they fixed this issue and everything should work fine
I am getting Error when try to run Flutter run iOS. Error is 'ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'card_scanner' not found #import card_scanner;'. Card Scanner package link
I have already done these things
Flutter clean
Pod deintegrate
Pod init
Pod install
Comment use framework! at Podfile
Here are my dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
device_info: 0.4.0+1
material_design_icons_flutter: ^4.0.5755
provider: 3.0.0
intl: ^0.16.1
http: ^0.12.2
shared_preferences: ^0.5.12+4
fluttertoast: ^7.1.1
flutter_launcher_icons: ^0.8.0
url_launcher: ^5.7.10
sqflite: ^1.3.0
path_provider: ^1.6.24
path_provider_macos: ^0.0.1
connectivity: ^2.0.2
flutter_secure_storage: ^3.3.5
flutter_google_places: ^0.2.6
async: ^2.4.2
flutter_credit_card: ^0.1.4
stripe_payment: ^1.0.9
progress_dialog: ^1.2.4
intercom_flutter: ^2.3.3
firebase_messaging: ^7.0.3
change_app_package_name: ^0.1.2
permission_handler: 5.1.0+2
card_scanner: ^0.2.0+3
I try to run my app on VSCode but I get this error:
I've tried to update flutter version/pubspec packages version/flutter clean/delete the build folder and run again. But nothing seems to work.
this is my pubspec.yaml
add_2_calendar: ^2.0.1
add_2_calendar: ^2.0.1
camera: ^0.7.0+2
charts_flutter: ^0.10.0
cupertino_icons: ^1.0.2
device_calendar: ^3.1.0
dio: ^3.0.10
dio_http_cache: ^0.2.9
expandable: ^5.0.1
firebase_core: ^0.7.0
firebase_database: ^6.0.0
firebase_messaging: ^8.0.0-dev.15
fl_chart: ^0.35.0
flick_video_player: ^0.1.1
flutter_email_sender: ^5.0.0
flutter_form_builder: ^6.0.0-nullsafety.1
flutter_icons: ^1.1.0
flutter_linkify: ^5.0.0
flutter_paginator: ^0.0.6
flutter_svg: ^0.19.3
flutter_widget_from_html: ^0.5.0+3
fluttericon: ^2.0.0
gallery_saver: ^2.0.1
geolocator: ^6.2.1
get_it: ^6.0.0
http: ^0.12.0+2
image_picker: ^0.6.2+3
intl: ^0.17.0
mailer: ^5.0.0
overlay_support: ^1.0.5
path_provider: ^1.6.11
permission_handler: ^5.0.1+1
provider: ^4.0.5
splashscreen: ^1.2.0
timeline_tile: ^2.0.0
url_launcher: ^5.5.0
video_player: ^0.10.12+2
weather_icons: ^2.0.2
webview_flutter: ^1.0.7
flutter --version
flutter doctor
The reason you get this is that you use flutter_widget_from_html, that has no null safe version yet, this package depends on old version of chewie (v0.10.4), that uses deprecated property of Scaffold resizeToAvoidBottomPadding.
What you can do is to downgrade your Flutter SDK to pre null-safety version, or rewrite your code without using flutter_widget_from_html package in favor for example chewie, that already has null safety widget.
You can check more info about migrating to null safety here.
If you are willing to downgrade your SDK to pre-null safety you can use this answer.
Details about issue : Because every version of flutter_driver from sdk depends on process 4.0.0-nullsafety.2 which depends on platform ^3.0.0-nullsafety.1, every version of flutter_driver from sdk requires platform ^3.0.0-nullsafety.1.
And because firebase_messaging >=0.2.0 <7.0.2 depends on platform ^2.0.0, flutter_driver from sdk is incompatible with firebase_messaging >=0.2.0 <7.0.2.
So, because receiptree depends on both firebase_messaging ^6.0.13 and flutter_driver any from sdk, version solving failed.
Running "flutter pub get" in working...
pub get failed (1; So, because xxxx depends on both firebase_messaging ^6.0.13 and flutter_driver any from sdk, version solving failed.)
Please help me to format below code
version: 0.9.9-beta+9
environment:
sdk: ">=2.7.0 <3.0.0"
depedencies:
Auth
firebase_auth: ^0.15.5+3
google_sign_in: ^4.4.0
flutter_facebook_login: ^3.0.0
apple_sign_in: ^0.1.0
Notification
firebase_messaging: ^6.0.13
firebase_dynamic_links: ^0.5.0+11
fluttertoast: ^4.0.1
Core
provider: ^4.0.4
auto_route: ^0.4.2
flutter_mobx: ^1.1.0
mobx: ^1.1.1
mobx_codegen: ^1.0.3
firebase_ml_vision: ^0.9.3+8
Dependency injection
inject:
git:
url: https://github.com/google/inject.dart.git
path: package/inject
ref: 7c3cbf6
Storage
shared_preferences: ^0.5.6+3
firebase_storage: ^3.1.5
cloud_firestore: ^0.13.4+2
UI
photo_view: ^0.9.2
flutter_page_indicator: 0.0.3
datetime_picker_formfield: ^1.0.0
image_picker: ^0.6.4
flutter_datetime_picker: ^1.4.0
image_cropper: ^1.2.1
flutter_typeahead: ^1.8.0
flutter_masked_text: ^0.8.0
video_player: null
Utility
flutter_svg: ^0.18.1
flutter_image_compress: ^0.6.5+1
firebase_analytics: ^5.0.11
firebase_crashlytics: ^0.1.3+3
package_info: ^0.4.0+16
http: ^0.12.2
dartz: ^0.9.1
faker: ^1.2.1
intl: ^0.16.1
printing: ^3.6.0
image_gallery_saver: ^1.5.0
dio: ^3.0.10
flutter_email_sender: ^3.0.1
Unknown
path_provider: ^1.6.5
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.3
random_string: ^2.1.0
permission_handler: ^5.0.1+1
share: ^0.6.5+2
url_launcher: ^5.7.1
dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^4.1.1
flutter_driver:
sdk: flutter
test: any
timeago: ^2.0.26
flutter_launcher_icons: ^0.8.0
auto_route_generator: ^0.4.0
build_runner: null
inject_generator:
git:
url: https://github.com/google/inject.dart.git
path: package/inject_generator
ref: 7c3cbf6
I faced the same problem. The problem is coming from firebase messaging.
Currently, you have:
firebase_messaging: ^6.0.13
which limits firebase messaging to a version 6.
Replace it with
firebase_messaging: ^7.0.0
And it should solve your issue.