Hoping you can help me out here. This project used to build without errors but then I updated Flutter and now I get this build error. Any quick help is greatly appreciated because I am hoping to build this and make a TestFlight release a.s.a.p to make a pitch. just FYI similar error when performing app bundle for Android.
I am not using maxLength or maxLengthEnforcment in my code at all. So, I think the has to do with a dependency related flutter_typeahead or another one from the yaml. Anyway, grateful for any help!
I tried updating dependency of flutter_typeahead to a higher versions.
I did a "flutter clean"
I did a "flutter pub upgrade"
Failed to build iOS app
Error (Xcode): ../../../.pub-cache/hosted/pub.dev/flutter_typeahead-1.9.3/lib/flutter_typeahead.dart:934:9: Error: No named parameter with the name 'maxLengthEnforced'.
This is my Flutter environment details:
Flutter 3.7.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9944297138 (6 days ago) • 2023-02-08 15:46:04 -0800
Engine • revision 248290d6d5
Tools • Dart 2.19.2 • DevTools 2.20.1
This is my pubspec.yaml:
name: app
description: A new Flutter project.
publish_to: 'none'
version: 0.0.91+4flutter
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
#firebase_core: ^0.5.0
pedantic: 1.9.0
google_fonts: ^1.1.0
hooks_riverpod: ^0.11.1
google_maps_flutter: ^1.0.2
flutter_typeahead: ^1.9.3
freezed_annotation: ^0.12.0
hive_flutter: ^0.3.1
http: ^0.12.2
multi_image_picker: ^4.7.14
maps_launcher: ^1.2.2+1
smooth_page_indicator: ^0.2.0
preload_page_view: ^0.1.4
charts_flutter: ^0.9.0
file: ^6.1.4
dev_dependencies:
flutter_test:
sdk: flutter
freezed: ^0.12.1
build_runner: any
analyzer: 0.39.14
json_serializable: ^3.5.0
flutter_launcher_icons: ^0.8.1
flutter:
uses-material-design: true
assets:
- assets/house.png
- assets/car.png
- assets/team.png
- assets/logo_transparent.png
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon2.png"
Related
When I tray to compile (there are no programming errors in screen) but in compilation show these error logs:
*/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.4+1/lib/custom_style.dart:17:13:
Error: The method 'CustomStyle.apply' has fewer named arguments than
those of overridden method 'TextStyle.apply'.
TextStyle apply({
^
This is my pubspec.yaml
name: myprject description: A new Flutter project. publish_to: 'none'
version: 1.0.0+1 environment: sdk: ">=2.12.0 <3.0.0" dependencies:
flutter: sdk: flutter cupertino_icons: ^1.0.2
flutter_staggered_grid_view: ^0.4.1 rflutter_alert: ^2.0.4
connectivity: ^3.0.6 path_provider: ^2.0.6 dio: ^4.0.1
percent_indicator: ^3.4.0 flutter_archive: ^4.1.0
flutter_webview_plugin: ^0.4.0 flutter_inappwebview: ^5.3.2
flutter_staggered_animations: ^1.0.0 flutter_scale_tap: ^1.0.5
intl: ^0.17.0 shared_preferences: ^2.0.8 flutter_svg: ^0.23.0+1
styled_text: ^3.0.4+1 audio_service: ^0.18.1 just_audio: ^0.9.18
url_launcher: ^6.0.16 permission_handler: ^8.3.0 animations:
^2.0.2 transformer_page_view: ^0.1.6 chewie: ^1.2.2
video_player: ^2.2.7 flutter_colorpicker: ^1.0.3 vibration:
^1.7.4-nullsafety.0 flare_flutter: ^3.0.2 rive: ^0.8.1
screenshot: ^1.2.3 share_plus: ^3.0.4 external_path: ^1.0.1
flame: ^1.0.0 flutter_fortune_wheel: ^1.2.0 elliptic_text:
^1.0.1+9
dev_dependencies: flutter_test:
sdk: flutter sqflite: ^2.0.0+4
flutter_lints: ^1.0.0 http: ^0.13.3 provider: ^5.0.0
flutter: uses-material-design: true assets:
- assets/ fonts:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Versión 10.0.19044.1645], locale es-MX)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.6)
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.66.2)
[√] Connected device (6 available)
[√] HTTP Host Availability
This looks like a mismatch between your Flutter version (which is relatively new) and a (half year) old version of the styled_text package. As I understand, there was a change in the function signature of the copyWith function in Style classes. Simply updating the dependency should work. Replace it in your pubspec.yaml file:
styled_text: ^5.1.0
As a general hint, you can run flutter pub outdated to identify packages that can be updated.
Windows 10 vs code 1.56.2
I'm using flutter 1.22.
I'm trying to upgrade flutter 2.2.0
[√] Flutter (Channel dev, 2.3.0-12.1.pre, on Microsoft Windows [Version 10.0.19042.985], locale ru-RU)
• Flutter version 2.3.0-12.1.pre at D:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f9c825981c (2 days ago), 2021-05-18 14:07:52 -0700
• Engine revision 26e217e6c3
• Dart version 2.14.0 (build 2.14.0-edge.a527411e5100a0a4f48c4009087a1b988aa784af)
Target of URI doesn't exist: 'package:flutter/material.dart'.
Try creating the file referenced by the URI, or Try using a URI for a file that does exist.
What I try:
flutter pub get
flutter pub upgrade
flutter clean
restart vs code
cry :d
change channel and upgrade
delete plugins in vs code and reinstall
restart PC
name: test
description: test client.
version: 4.0.703
environment:
sdk: '>=2.13.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
rxdart: ^0.24.1
flutter_local_notifications_platform_interface: ^2.0.0
timezone: ^0.6.1
flutter_launcher_icons: ^0.8.1
shared_preferences: ^0.5.12+2
json_annotation: ^3.1.0
http: ^0.12.2
firebase_core: "^0.5.2"
firebase_messaging: "^8.0.0-dev.8"
date_range_picker: ^1.0.6
flutter_datetime_picker: ^1.4.0
video_player: ^0.10.12+5
url_launcher:
chewie: ^0.9.10
flutter_local_notifications: ^4.0.1+2
permission_handler: ^5.0.1+1
device_info: ^1.0.0
path_provider: ^1.6.24
wakelock: ^0.1.2
sip_ua:
path: ../modules/dart-sip-ua-master
image_picker:
flutter_icons:
ios: true
android: true
image_path_ios: "assets/launcher/icon.png"
image_path_android: "assets/launcher/icon.png"
adaptive_icon_background: "assets/launcher/background.png"
adaptive_icon_foreground: "assets/launcher/foreground.png"
dev_dependencies:
build_runner:
json_serializable: ^3.5.0
mockito: ^4.1.1
plugin_platform_interface: ^1.0.1
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- images/logo.png
- images/cctvback.png
I have this dependency conflict:
$ flutter pub upgrade --dry-run
Resolving dependencies...
Because image >=2.1.14 <3.0.0-nullsafety.0 depends on archive ^2.0.0 and image >=2.0.4 <2.1.14 depends on archive >=1.0.16 <3.0.0, image >=2.0.4 <3.0.0-nullsafety.0 requires archive >=1.0.16 <3.0.0.
And because flutter_launcher_icons >=0.7.1 <0.9.0 depends on image ^2.1.1 and every version of flutter_driver from sdk depends on archive 3.1.2, flutter_launcher_icons >=0.7.1 <0.9.0 is incompatible with flutter_driver from sdk.
So, because gallery depends on both flutter_driver any from sdk and flutter_launcher_icons ^0.8.1, version solving failed.
pub finished with exit code 1
Versions
$ dart --version
Dart SDK version: 2.13.0-222.0.dev (dev) (Fri Apr 9 12:15:17 2021 -0700) on "macos_x64"
$ flutter --version
Flutter 2.1.0-13.0.pre.574 • channel master • https://github.com/flutter/flutter
Framework • revision 02efffc134 (2 days ago) • 2021-04-10 03:49:01 -0400
Engine • revision 8863afff16
Tools • Dart 2.13.0 (build 2.13.0-222.0.dev)
pubspec.yaml
name: gallery
description: A resource to help developers evaluate and use Flutter.
repository: https://github.com/flutter/gallery
version: 2.8.1+020801
environment:
sdk: ">=2.6.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ">=0.16.1 <=0.17.0"
flutter_localized_locales: ">=1.1.1 <=2.0.0"
cupertino_icons: ^1.0.0
rally_assets: ^2.0.0
meta: ^1.1.8
scoped_model: ^1.1.0
shrine_images: ^1.1.2
url_launcher: ^5.6.0
vector_math: ^2.0.8
collection: ^1.14.0
flutter_gallery_assets: ^0.2.6
package_info: ^0.4.0
google_fonts: ^1.1.2
flutter_staggered_grid_view: ^0.3.3
animations: ^1.1.2
provider: ^4.3.2
adaptive_breakpoints: ^0.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
test:
path:
args:
grinder: ^0.8.0
pedantic: ^1.9.0
string_scanner: ^1.0.5
web_benchmarks: ^0.0.3
flutter_launcher_icons: "^0.8.1"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/logo/roof.png"
flutter:
assets:
- packages/flutter_gallery_assets/assets/studies/shrine_card_dark.png
- ...
...
Tried
I changed:
flutter_launcher_icons: "^0.8.1"
to:
flutter_launcher_icons: "^0.9.0"
But it couldn't help.
Question
I cannot figure out how to resolve the conflict. Is there a standard way for such conflict resolutions which I might be missing?
you can run in your project terminal
flutter pub upgrade --major-versions
Because your project depends on flutter_launcher_icons and flutter_driver
and both packages depend on the third package archive with different versions.
flutter_launcher_icons: "^0.8.1" depends on archive: ">=2.0.4 <3.0.0-nullsafety.0" and flutter_driver from sdk depends on archive: 3.1.2, So there is conflict of resolving version of archive package.
So to resolve this conflict you have to add the manual entry in pubspec.yaml file of your project.
dependency_overrides:
archive: 3.1.2 //any version you want for resolution.
And to know how to flutter resolves dependencies, check the below link.
https://medium.com/cashify-engineering/flutter-dependencies-resolution-2faecdbfce03
this link also describes a standard way of resolving such dependency conflict.
I recently updated the Flutter version from my previous version to 2.0, but with few exceptions occurring I decided to downgrade back to where my flutter version was(1.22.6) on stable channel.
now I get this error on pub get
Because every version of flutter_test from sdk depends on path 1.8.0-nullsafety.1 and PawFect depends on path ^1.8.0, flutter_test from sdk is forbidden.
So, because PawFect depends on flutter_test any from sdk, version solving failed.
pub get failed (1; So, because PawFect depends on flutter_test any from sdk, version solving failed.)
my pubspec.yaml looks like this now.
...
version: 1.0.25+7
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
#Firebase Core API
firebase_core: ^0.7.0
#firebase analytics
firebase_analytics: ^7.0.1
#firebase crashlytics
firebase_crashlytics: ^0.4.0+1
#firebase performance
firebase_performance: ^0.5.0+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
shared_preferences: ^0.5.12+4
shimmer: ^1.1.2
lite_rolling_switch: ^0.1.1
intl: ^0.17.0
# country_code_picker: ^1.7.0
image_picker: ^0.6.7+21
connectivity: ^3.0.3
# flutter_spinkit: ^4.1.2+1
# gallery_saver: ^2.0.1
# camera: ^0.5.8+5
path: ^1.8.0
http: ^0.12.2
toggle_switch: ^0.1.8
pie_chart: ^5.0.0
fl_chart: ^0.20.1
percent_indicator: ^2.1.9
simple_animations: ^2.4.2
package_info: ^0.4.3+2
# dio: ^3.0.10
sqflite: ^2.0.0+3
path_provider: ^1.6.27
get_it: ^6.0.0
progress_dialog: ^1.2.4
mime: ^0.9.7
http_parser: ^3.1.4
flutter_image_compress: ^0.7.0
flutter_launcher_icons: ^0.9.0
device_preview: ^0.7.1
fluttertoast: ^7.1.6
in_app_purchase: ^0.3.5+1
font_awesome_flutter: ^9.0.0
# rename: ^1.3.0
expansion_tile_card: ^2.0.0
url_launcher: ^6.0.2
provider: ^4.3.2+4
# number_display: ^2.3.0
# functional_widget_annotation: ^0.8.0
# stripe_payment: ^1.0.9
flutter_icons:
# android: "launcher_icon"
image_path: "assets/images/pawfect_logo.png"
# image_path_android: "assets/images/logo_large.png"
# image_path_ios: "assets/images/logo_large.png"
android: true # can specify file name here e.g. "ic_launcher"
ios: true # can specify file name here e.g. "My-Launcher-Icon"
# adaptive_icon_background: "assets/images/christmas-background.png" # only available for Android 8.0 devices and above
# adaptive_icon_foreground: "assets/images/icon-foreground-432x432.png" # only available for Android 8.0 devices and above
dev_dependencies:
flutter_test:
sdk: flutter
..
How can I resolve this error, and get dependencies without an issue.?
flutter doctor
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H114 darwin-x64,
locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[!] Android Studio (version 4.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
! No devices available
flutter_test seems to require null safety from at least 1.8.0 to work properly, and the error was thrown when the Flutter version that you're using was downgraded. There's a GitHub ticket filed to document this behavior. The workaround on this issue is to manage the versions that you're using to at least match the minimum dependency set.
I still cannot figure this thing out. I got this error message when I do flutter pub get:
Because no versions of flutter_i18n match >0.20.1 <0.21.0 and flutter_i18n 0.20.1 depends on intl ^0.16.0, flutter_i18n ^0.20.1 requires intl ^0.16.0.
And because every version of flutter_localizations from sdk depends on intl 0.17.0-nullsafety.2, flutter_i18n ^0.20.1 is incompatible with flutter_localizations from sdk.
So, because my_app depends on both flutter_localizations any from sdk and flutter_i18n ^0.20.1, version solving failed.
pub get failed (1; So, because my_app depends on both flutter_localizations any from sdk and flutter_i18n ^0.20.1, version solving failed.)
But I don't get this message in stable channel.
So far I always just switch back and forth. But I want to find the solution once and for all, because some tasks I need to do in master or dev channels.
Here is my pubspec.yaml file
environment:
sdk: ">=2.7.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
# UI related packages
cupertino_icons: ^1.0.0
gradient_app_bar: ^0.1.3
bubbled_navigation_bar: ^0.0.4
titled_navigation_bar: ^3.6.0
bubble_tab_indicator: ^0.1.4
flutter_i18n: ^0.20.1
gradient_widgets: ^0.5.0
flutter_form_builder: ^3.14.0 # must be 3.14.0 because 3.14.1 will break
keyboard_dismisser: ^1.0.2
font_awesome_flutter: ^8.5.0
sliding_up_panel: ^1.0.2
lazy_load_scrollview: ^1.1.0
pull_to_refresh: ^1.6.2
scroll_to_index: ^1.0.6
date_time_format: ^1.0.0+4
like_button: ^1.0.1
# Login & App Store packages
flutter_facebook_login: ^3.0.0
google_sign_in: ^4.5.4
sign_in_with_apple: ^2.5.4
purchases_flutter: ^1.4.0
# Informing User / Loading
flutter_spinkit: ^4.0.0
progress_dialog: ^1.2.4
shimmer: ^1.1.1
flushbar: ^1.10.4
rflutter_alert: ^1.0.3
loading:
git:
url: git://github.com/leonzone/loading.git
path: loading
ref: 8f5a63f
# I/O, Cache & Databases
path: ^1.7.0
path_provider: ^1.6.16
shared_preferences: ^0.5.12+4
flutter_secure_storage: ^3.3.5
flutter_cache_manager: ^1.4.2
sembast: ^2.4.7+7
sembast_cloud_firestore_type_adapters:
git:
url: git://github.com/tekartik/sembast_flutter_more.dart
path: cloud_firestore_type_adapters
ref: dart2
version: '>=0.1.0'
# Code structure, connectivity & internal services
flutter_bloc: ^6.1.0
provider: ^4.3.2+2
http: ^0.12.1
equatable: ^1.2.5
simple_connectivity: ^0.1.1
network_image_to_byte: ^0.0.1
image_picker: ^0.6.7+11
image: ^2.1.14
package_info: ^0.4.1
flutter_device_type: ^0.2.0
audioplayers: 0.17.0
url_launcher: ^5.7.8
device_info: ^1.0.0
in_app_review: ^1.0.3
petitparser: ^3.0.2
convert: ^2.1.1
flutter_chips_input: ^1.9.3
vector_math: ^2.0.8
path_drawing: ^0.4.1
matrix_gesture_detector: ^0.1.0
# Social share packages
social_share_plugin: ^0.3.1+1
share: ^0.6.5+4
# Firebase packages
firebase_core: ^0.5.3
firebase_auth: ^0.18.4
cloud_firestore: ^0.14.4
firebase_storage: ^5.2.0
firebase_database: ^4.4.0
cloud_functions: ^0.7.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- assets/images/
- assets/i18n/
- assets/audio/
fonts:
- family: Varela Round
fonts:
- asset: fonts/VarelaRound-Regular.ttf
- family: Font Awesome
fonts:
- asset: fonts/FontAwesome-Regular.otf
And here is my flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.25.0-5.0.pre.141, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.51.1)
[✓] Connected device (2 available)
• No issues found!
Anyone knows whats wrong here?
Once again, I don't have this problem in stable channel.
Thanks a lot.
The dart and flutter teams are transitioning to null-safety feature. It is still in beta (that is why you get this error just with the beta channel). Not every package are already upgraded to null-sefety. You can fix this issue either by:
asking the developer of the package to upgrade to null safety
use a version of flutter which has not null-safety enabled
use a beta version of the package with null-sefty enabled
Check also this issue