version solving failing not getting the sollution - flutter

This is my pubspec.yaml where I have added firebase_auth and cloud_firebase:
name: my_khata
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
firebase_auth: ^1.0.1
cloud_firestore: ^1.0.3
error I am getting:
The current Dart SDK version is 2.12.0-259.16.beta.
Because my_khata requires SDK version >=2.12.0 <3.0.0, version solving failed.
pub get failed (1; Because my_khata requires SDK version >=2.12.0 <3.0.0, version solving failed.)
please tell me the solution

Try using this
cupertino_icons: ^1.0.2
firebase_core: ^1.0.2
firebase_auth: ^1.0.1
cloud_firestore: ^1.0.3
I think you need to check your flutter channel(Stable recommended) if above solution not working you can try any like this
firebase_auth: any
cloud_firestore: any

Related

Dart SDK version mismatch

version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
hive: ^1.0.0
hive_flutter: ^0.2.1
path_provider: ^1.3.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
integration_test:
sdk: flutter
build_runner: ^2.1.1
hive_generator: ^0.5.1
pub get failed (1; Because depends on path_provider >=2.0.0 which requires SDK version >=2.12.0-259.9.beta <3.0.0, version solving failed.)
exit code 1
how to fix it?
Hi #Sreerekha and welcome to StackOverflow!
cupertino_icons: ^1.0.2 has null-safety enabled, so you have to:
upgrade your SDK to version 2.12 (or higher) and migrate all your app to null-safety,
or you have to downgrade the version of this dependency.
Unfortunately, you can't have the best of both worlds
How_to_migrate_to_null_safety
Cupertino_icons_versions

So, because postureapp depends on both audioplayers ^0.17.0 and flutter_driver any from sdk, version solving failed

After a long time, I am trying to run my flutter project that used to run successfully. After doing flutter upgrade, I get the following dependency error. I have tried multiple possible fixes from similar issues I have found, but I still get similar errors. Any help is much appreciated.
Because audioplayers >=0.16.2 <0.18.0 depends on uuid ^2.2.2 and no versions of uuid match >2.2.2 <3.0.0, audioplayers >=0.16.2 <0.18.0 requires uuid 2.2.2.
And because uuid 2.2.2 depends on crypto ^2.0.0 and every version of flutter_driver from sdk depends on crypto 3.0.1, audioplayers >=0.16.2 <0.18.0 is incompatible with flutter_driver from sdk.
So, because postureapp depends on both audioplayers ^0.17.0 and flutter_driver any from sdk, version solving failed.
pub get failed (1; So, because postureapp depends on both audioplayers ^0.17.0 and flutter_driver any from sdk, version solving failed.)
exit code 1
my pubspec.yaml file:
environment:
sdk: ">=2.2.0 <3.0.0" # ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
image_picker: ^0.6.5
firebase_core: ^1.0.0 #^0.7.0
firebase_ml_vision: ^0.10.0 #^0.9.3+8
camera: ^0.8.0 #^0.5.6+1
smooth_page_indicator: ^0.1.5
simple_animations: ^2.1.1
flutter_statusbarcolor: ^0.2.3
gradient_widgets: ^0.5.1
time: "^1.3.0"
audioplayers: ^0.17.0 #^0.15.1
path_provider: ^1.6.0 #^1.5.1
wakelock: ^0.1.4+1
poller: ^1.1.3
permission_handler: ^6.1.0
mutex: ^1.1.0
dependency_overrides:
path_provider: ^2.0.0
dev_dependencies:
pedantic: ^1.8.0
e2e: ^0.2.1
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
test: any
path: ^1.6.2
flutter_launcher_icons: ^0.8.1
flutter_launcher_name: ^0.0.1
# path_provider: ^0.5.0+1
flutter_icons:
image_path: "assets/images/logo.png"
android: true
ios: true
flutter_launcher_name:
name: "MyApp"
flutter:
uses-material-design: true
assets:
- assets/images/
- assets/sounds/
Removing the version number of audioplayer, and some other libraries fixed the issue.

Flutter Invalid plugin specification path_provider_windows

when I try to add libraries in which cache images from server like :
cached_network_image
flutter_advanced_networkimage
the lib download to lib folder but project can't be build and show error:
Invalid plugin specification path_provider_windows.
Invalid "windows" plugin specification.
here is my pubspec.yaml
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
get_it: ^2.0.1
flutter_bloc: ^4.0.0
equatable: ^0.4.0
dartz: ^0.8.6
data_connection_checker: ^0.3.4
dio: ^3.0.10
shared_preferences: ^0.5.3+4
image_picker: ^0.6.7
#flutter_advanced_networkimage: ^0.7.0
#cached_network_image: ^2.3.2+1
google_maps_flutter: ^0.5.28+1
permission_handler: ^5.0.0+hotfix.8
url_launcher: ^5.4.10
mailto: ^0.2.0+1
shamsi_date: ^0.9.0
firebase_core: ^0.4.0+9
firebase_analytics: ^5.0.2
firebase_messaging: ^6.0.16
firebase_crashlytics: ^0.1.3+3
dev_dependencies:
flutter_test:
sdk: flutter
gen_lang: 0.1.3
mockito: ^4.1.0
flutter_launcher_icons: "^0.7.3"
This isn't technically me answering the question however the dev team have picked up on this issue and they are in the process of fixing it
Here is the github link to their fix: https://github.com/flutter/flutter/issues/66158
EDIT:
According to the issue logged on Github a fix would be to pub upgrade which would theoretically upgrade you to the latest working version of path_provider, not sure if this works though I have yet to try it myself

pub get failed:version solving failed

Flutter_test depends on meta 1.1.8 and firebase_login depends on meta ^1.2.2.
firebase_login depends on flutter_test any from sdk, version solving failed.
pub get failed
pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
firebase_auth: ^0.18.0+1
equatable: ^1.2.4
google_sign_in: ^4.5.3
meta: ^1.2.2
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
lint: any
You can get both by
dependencies:
meta: ^1.2.2
dependency_overrides:
meta: ^1.1.8
I have same problem with bloc:
Because every version of passcode_navigator from git depends on flutter_bloc ^7.3.3 and every version of feature_menu from path depends on flutter_bloc ^8.0.0, passcode_navigator from git is incompatible with feature_menu from path
I resolve it with adding to pubspec:
dependency_overrides:
flutter_bloc: any
Do this,
meta: ^1.1.8
And then, run this,
flutter pub get
hi there try to downgrade the version of meta to 1.1.8 i tried and it worked with me in flutter 1.20.1
I experienced a similar issue with Firebase auth and permission_handler:
# pubspec.yaml:
dependencies:
flutter:
sdk: flutter
firebase_auth: ^1.4.1
permission_handler: ^5.1.0+2
The error message (truncated):
Because permission_handler ^5.1.0 depends on permission_handler_platform_interface ^2.0.2 which depends on plugin_platform_interface ^1.0.2, permission_handler ^5.1.0 requires plugin_platform_interface ^1.0.2.
And because firebase_auth 1.4.1 depends on firebase_core_platform_interface ^4.0.1 and no versions of firebase_auth match >1.4.1 <2.0.0, permission_handler ^5.1.0 is incompatible with firebase_auth ^1.4.1.
So, because my_flutter_project depends on both firebase_auth ^1.4.1 and permission_handler ^5.1.0+2, version solving failed.
A solution that worked for me:
Update permission_handler to the latest version:
flutter pub add permission_handler
Update meta to 1.2.2
meta: ^1.2.2
also update flutter using flutter upgrade command
flutter upgrade

Flutter image version issue

I have just upgraded my flutter version and now I am facing the following issue when I get the packages in pubsec.yml file:
Because every version of flutter_test from sdk depends on image 2.1.4 and Instant_Feedback depends on image ^2.1.9, flutter_test from sdk is forbidden.
So, because Instant_Feedback depends on flutter_test any from sdk,
version solving failed. pub get failed (1; So, because
Instant_Feedback depends on flutter_test any from sdk, version solving
failed.)
My pubsec.yml file
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+2
shared_preferences: ^0.5.4+8
firebase_messaging: ^6.0.3
flutter_crashlytics: ^1.0.0
firebase_core: ^0.4.2+1
cupertino_icons: ^0.1.3
device_calendar: ^1.0.0+2
cloud_firestore: ^0.12.11
auto_size_text: ^2.1.0
flutter_expandable_menu: ^0.0.1
webview_flutter: ^0.3.17
flutter_spinkit: ^4.1.1+1
get_it: 2.1.0
bloc: ^0.15.0
flutter_bloc: 0.21.0
equatable: 0.5.1
rflutter_alert: ^1.0.3
expandable: ^3.0.1
connectivity: ^0.4.6
firebase_auth: ^0.15.1
flutter_email_sender: ^2.2.1
mockito: 4.1.1
flutter_secure_storage: ^3.3.1+1
image_picker: ^0.6.2+2
async: any
image: ^2.1.10
image_crop: ^0.3.1
flutter_cache_manager: ^1.1.3
circular_profile_avatar: ^1.0.3
package_info: ^0.4.0+12
flutter_local_notifications: ^0.8.4+3
flutter_webview_plugin: ^0.3.10
url_launcher: ^5.2.7
flutter_localizations:
sdk: flutter
flutter_cupertino_localizations: ^1.0.1
dev_dependencies:
flutter_driver:
sdk: flutter
test: any
ozzie: 2.0.1
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- lib/app/assets/images/
- lib/app/assets/flags/
- lang/en.json
- lang/de.json
Because every version of flutter_test from sdk depends on image 2.1.4 and Instant_Feedback depends on image ^2.1.9, flutter_test from sdk is forbidden.
I faced the same issue. Couldn't find the specific reason for the flutter_test depending on a specific version of this image library. Maybe it's an issue from the flutter side. So here are some workaround solutions:
comment out the flutter_test dev_dependency.
dev_dependencies:
# flutter_test:
# sdk: flutter
set the required version.
Instead of 2.1.12, I set the Image package version to 2.1.4 (as requested in the error message)
image: ^2.1.4
If more than one packages versions are noncompatible to each other, and you don't know their exact compatible version, you can find it by setting both the conflicting dependencies to any, e.g.
flutter_crashlytics: any
firebase_core: any
This will automatically figure out the compatible package version. Check these new compatible versions in pubspec.lock file, which will be auto-generated by running flutter package get.
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
packages:
flutter_crashlytics:
...
version: "1.0.0"
firebase_core:
...
version: "0.4.2+1"
Replace any with those correct versions.
flutter_crashlytics: 1.0.0
firebase_core: 0.4.2+1
Note: You should never leave your versions as any