Pubspec.yaml resolving version failed in master channel but works in stable channel in Flutter - flutter

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

Related

Flutter run on iOS device fails with API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user ident

Error on console
In module 'GameKit' imported from
/Users/tenna/Desktop/Customers/sflo_admin_app/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/AuthProvider/GameCenter/FIRGame
CenterAuthProvider.m:18:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Fr
ameworks/GameKit.framework/Headers/GKLocalPlayer.h:133:1: note:
'generateIdentityVerificationSignatureWithCompletionHandler:' has been explicitly marked deprecated here
- (void)generateIdentityVerificationSignatureWithCompletionHandler:(void (^__nullable)(NSURL * __nullable publicKeyUrl,
NSData * __nullable signature, NSData * __nullable salt, uint64_t timestamp, NSError * __nullable
error))completionHandler API_DEPRECATED("API deprecated. Use fetchItemsForIdentityVerificationSignature: and the
teamPlayerID value to verify a user identity.", ios(7.0, 13.5), tvos(9.0, 13.4.8), macosx(10.10, 10.15.5),
watchos(3.0,6.5));
...
bunch of
'Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs....' warnings
...
Could not build the precompiled application for the device.
Error launching application on tenna (2).
% flutter doctor
Flutter (Channel stable, 3.3.10, on macOS 12.5 21G72 darwin-arm, locale ja-JP)
Android toolchain - develop for Android devices (Android SDK version 33.0.0)
Xcode - develop for iOS and macOS (Xcode 14.2)
Chrome - develop for the web
Android Studio (version 2021.2)
VS Code (version 1.74.3)
Connected device (4 available)
HTTP Host Availability
No issues found!
pubspec.yaml
environment:
sdk: ">=2.16.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
flutter_staggered_grid_view: ^0.6.0
firebase_core: ^2.4.0
firebase_analytics: ^10.0.8
firebase_auth: ^4.2.2
cloud_firestore: ^4.3.0
firebase_storage: ^11.0.9
google_sign_in: ^5.1.0
sign_in_with_apple: ^3.0.0
crypto: ^3.0.1
url_launcher: ^6.0.12
image_picker: ^0.8.4
keyboard_actions: ^3.4.4
cached_network_image: ^3.2.0
pull_to_refresh: ^2.0.0
flutter_datetime_picker: ^1.5.1
intl: ^0.18.0
flutter_image_compress: ^1.1.0
fl_chart: ^0.41.0
firebase_messaging: ^14.2.0
firebase_analytics_web: ^0.5.1+7
transparent_image: ^2.0.0
fcm_config: ^3.3.4
flutter_app_badger: ^1.3.0
http: ^0.13.4
progress_dialog: ^1.2.2
flutter_number_picker: ^1.0.4
permission_handler: ^9.2.0
share_plus: ^4.0.2
intl_phone_number_input: ^0.7.0+2
flutter_state_notifier: ^0.7.1
shared_preferences: ^2.0.15
dotted_line: ^3.1.0
geocoder2: ^1.1.2
open_mail_app: ^0.4.5
csv: ^5.0.1
file_saver: ^0.1.0
flutter_launcher_icons: ^0.9.3
The project was building fine a few week ago, this started to happen suddenly.
What is causing this error??
Tried flutter run.
Expected to start the app on my actual iOS device.
Device info:
iPhone 11, iOS 16.2

CocoaPods could not find compatible versions for pod "FBSDKLoginKit" inside ios directory

I have flutter app and I am getting the following error when I run the command:
pod install --repo-update
Here are is the error I am getting:
[!] CocoaPods could not find compatible versions for pod "FBSDKLoginKit":
In Podfile:
flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`) was resolved to 4.3.0, which depends on
FBSDKLoginKit (~> 13)
flutter_login_facebook (from `.symlinks/plugins/flutter_login_facebook/ios`) was resolved to 1.4.0, which depends on
FBSDKLoginKit (~> 12.3)
The error started appearing after I upgraded to the latest flutter packages.
Here is the packages I am using in pubspeck.yaml:
dependencies:
badges: ^2.0.1
cached_network_image: ^3.2.0
carousel_slider: ^4.0.0
cloud_firestore: ^3.1.0
cloud_functions: ^3.1.0
connectivity_plus: ^2.0.2
cupertino_icons: ^1.0.3
device_info_plus: ^3.2.2
dotted_border: ^2.0.0+2
firebase_analytics: ^8.3.4
firebase_auth: ^3.2.0
firebase_core: ^1.10.0
firebase_crashlytics: ^2.3.0
firebase_dynamic_links: ^4.0.6
firebase_in_app_messaging: ^0.5.0+14
firebase_messaging: ^11.1.0
firebase_storage: ^10.1.0
flash: ^2.0.3
flutter:
sdk: flutter
flutter_hooks: ^0.18.0
flutter_image_compress: ^1.1.0
flutter_launcher_icons: ^0.9.2
flutter_local_notifications: ^9.4.0
flutter_login_facebook: ^1.2.0
flutter_markdown: ^0.6.8
flutter_slidable: ^0.6.0
flutter_svg: ^1.0.3
flutterfire_ui: ^0.3.4
freezed_annotation: ^1.1.0
geocoding: ^2.0.4
geolocator: ^8.2.0
google_fonts: ^2.1.0
google_sign_in: ^5.2.1
hive: ^2.0.4
hive_flutter: ^1.1.0
hooks_riverpod: ^1.0.0
http: ^0.13.4
image_cropper: ^1.4.1
image_picker: ^0.8.4+4
linkable: ^3.0.1
material_design_icons_flutter: ^5.0.6295
open_mail_app: ^0.4.5
path_provider: ^2.0.9
package_info_plus: ^1.3.0
pattern_formatter: ^2.0.0
permission_handler: ^8.2.6
photo_view: ^0.13.0
purchases_flutter: ^3.5.0
rate_my_app: ^1.1.1+1
share: ^2.0.4
shared_preferences: ^2.0.8
shimmer: ^2.0.0
timeago: ^3.1.0
tuple: ^2.0.0
url_launcher: ^6.0.20
uuid: ^3.0.5
webview_flutter: ^3.0.0
dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^5.1.0
I tried the following things:
deleted Podfile.lock
ran flutter clean
inside Podfile I have (platform :ios, '11.0')
Thanks for your help in advance.
This is what I get when I run flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale en-AE)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.67.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
just delete your ios workspace , pods file and pod.lock then,
change the platform :ios, '12.0' in your podfile
after execute pod install and run the project its work for me
Here how I solved the problem based on a suggestion by "darwin-morocho
/flutter-facebook-auth"
you must remove flutter_login_facebook from your pubspec.yaml, also
flutter_facebook_auth must be in your dependencies

Flutter not compiling error Error: The method 'CustomStyle.copyWith' has fewer named arguments than those of overridden method 'TextStyle.copyWith'

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.

Because every version of flutter_test from sdk depends on path 1.8.0-nullsafety.1

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.

flutter 2.0.1 pub get failed

I`ve upgraded to the recent flutter version 2.0.1.
My pubspec.yaml
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
background_fetch: ^1.0.0-nullsafety.1
camera: ^0.8.0
cupertino_icons: ^1.0.2
dio: ^4.0.0-beta7
division: ^0.8.8
easy_localization: ^3.0.0
expandable: ^4.1.4
firebase_messaging: ^9.0.0
fixnum: ^1.0.0
firebase_core: ^1.0.1
flutter_ble_lib: ^2.3.2
flutter_datetime_picker: ^1.5.0
flutter_local_notifications: ^5.0.0-nullsafety.1
flutter_svg: ^0.21.0-nullsafety.0
freezed_annotation: ^0.14.0
fluttertoast: ^7.1.8
freezed: ^0.14.0+1
get: ^4.0.0-nullsafety.2
get_it: ^6.0.0
hive_flutter: ^1.0.0
hex: ^0.2.0
intl: ^0.17.0
location: ^4.1.1
logger: ^1.0.0-nullsafety.0
lottie: ^1.0.1
mask_text_input_formatter: ^2.0.0-nullsafety.2
package_info: ^2.0.0
path_provider: ^2.0.1
permission_handler: ^6.0.1+1
protobuf: ^2.0.0
protoc_plugin: ^20.0.0
plugin_platform_interface: ^2.0.0
rxdart: ^0.26.0
scrollable_positioned_list: ^0.2.0-nullsafety.0
sms_autofill: ^1.3.1
sprintf: ^6.0.0
system_settings: ^1.0.1
timezone: ^0.7.0-nullsafety.0
uuid: ^3.0.1
url_launcher: ^6.0.2
visibility_detector: ^0.2.0-nullsafety.1
dev_dependencies:
flutter_test:
sdk: flutter
test:
hive: ^2.0.0
build_runner: ^1.11.5
effective_dart: ^1.3.1
json_serializable: ^4.0.2
flutter_oss_licenses: ^1.0.0
flutter:
uses-material-design: true
When i run flutter pub get
I get an error:
Because genius_app depends on path_provider 2.0.1 which doesn't match any versions, version solving failed.
pub get failed (1; Because genius_app depends on path_provider 2.0.1 which doesn't match any versions, version solving failed.)
And this is not related to the path_provider, because if i remove this package, i start to receive same error for other packages
Ive tried to work with fvm` - and everything works just fine.
This error is happens only when i use local flutter environment
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.3 20D91 darwin-x64, locale
en-IL)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
[✓] VS Code (version 1.52.1)
[✓] Connected device (1 available)