Diagnosing Flutter version solving issue - flutter

While following the instructions to add integration tests to my Flutter app, I get the following error running packages get:
Because test <1.3.0 requires SDK version >=1.8.0 <2.0.0-∞ and test >=1.3.0 <1.6.1 depends on stream_channel ^1.6.0, test <1.6.1 requires stream_channel ^1.6.0.
And because test >=1.6.0 <1.6.5 depends on analyzer >=0.26.4 <0.37.0 and test >=1.6.4 <1.6.8 depends on test_api 0.2.6, test <1.6.8 requires stream_channel ^1.6.0 or analyzer >=0.26.4 <0.37.0 or test_api 0.2.6.
And because test >=1.6.8 <1.6.11 depends on test_api 0.2.7 and test >=1.6.11 depends on test_api 0.2.8, every version of test requires test_api 0.2.6 or 0.2.7 or 0.2.8 or stream_channel ^1.6.0 or analyzer >=0.26.4 <0.37.0.
And because every version of flutter_test from sdk depends on both stream_channel 2.0.0 and test_api 0.2.5, if flutter_test any from sdk and test any then analyzer >=0.26.4 <0.37.0.
And because json_serializable 3.2.3 depends on analyzer >=0.37.1 <0.39.0 and my_app depends on test any, flutter_test from sdk is incompatible with json_serializable 3.2.3.
So, because my_app depends on both json_serializable 3.2.3 and flutter_test any from sdk, version solving failed.
That presumably indicates some sort of version conflict through the dependency graph, but I'm at a bit of a loss to work out quite what exactly the issue is or what I could do about it. My pubspec.yaml looks like:
environment:
sdk: ">=2.2.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
flutter_svg: 0.14.2
email_validator: 1.0.0
dio: 3.0.2
dio_cookie_manager: 1.0.0
cookie_jar: 1.0.1
provider: 3.1.0
path_provider: 1.3.0
json_annotation: 3.0.0
timeago: 2.0.19
flutter_launcher_icons: 0.7.3
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: 1.7.1
json_serializable: 3.2.3
mockito: 4.1.1
flutter_driver:
sdk: flutter
test: any
Hoping someone can give me a pointer in the right direction.

did you try to remove the test dependency from the pubsec.yaml?
Looks like that the flutter_test package is already present on the flutter SDK.

Related

problem adding flutter_dialogflow dependency into flutter

I'm trying to make a chatbot using dialogflow in flutter and currently facing this error trying to add dialogflow dependency and i do not know how to solve it. can anyone help?
The current Dart SDK version is 2.16.2.
Because firebase_auth >=3.3.15 depends on firebase_auth_web ^3.3.13 and no versions of firebase_auth_web match >3.3.13 <4.0.0, firebase_auth >=3.3.15 requires firebase_auth_web 3.3.13.
(1) So, because firebase_auth_web 3.3.13 depends on http_parser ^4.0.0 and http >=0.11.3+17 <0.13.0-nullsafety.0 depends on http_parser >=0.0.1 <4.0.0, firebase_auth >=3.3.15 is incompatible with http >=0.11.3+17 <0.13.0-nullsafety.0. Because flutter_dialogflow <0.1.0 requires SDK version >=1.8.0 <2.0.0 and flutter_dialogflow >=0.1.0 <0.1.3 depends on http ^0.11.3+16, flutter_dialogflow <0.1.3 requires http ^0.11.3+16.
And because http >=0.2.8+2 <0.11.3+17 requires SDK version <2.0.0 and flutter_dialogflow >=0.1.3 depends on http ^0.12.0+2, every version of flutter_dialogflow requires http ^0.11.3+17 or ^0.12.0+2.
And because firebase_auth >=3.3.15 is incompatible with http >=0.11.3+17 <0.13.0-nullsafety.0 (1), firebase_auth >=3.3.15 is incompatible with flutter_dialogflow.
So, because knowyoursim_app depends on both firebase_auth ^3.3.15 and flutter_dialogflow any, version solving failed.
Running "flutter pub get" in knowyoursim_app...
pub get failed (1; So, because knowyoursim_app depends on both firebase_auth ^3.3.15 and flutter_dialogflow any, version solving failed.)
this is my dependencies
environment:
sdk: ">=2.16.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
style icons.
cupertino_icons: ^1.0.2
firebase_core: ^1.15.0
firebase_auth: ^3.3.15
test: ^1.19.5
bloc: ^8.0.3
flutter_bloc: ^8.0.1
equatable: ^2.0.3
flutter_launcher_icons: ^0.9.2
search_app_bar_page: ^2.1.2
#dialog_flowtter: ^0.3.3
bubble:
intl:
flutter_dialogflow:
Hi try those steps and it might work :
1 - type '$flutter clean' on console.
2 - then run '$flutter pub get' .
3 - then '$flutter pub outdated' .
4 - after that run '$flutter pub upgrade --major-versions' that should force it to upgrade your packages .
Make sure you are installing the latest dialogflow dependencies..
dialogflow_flutter: ^1.0.0
or try using this sdk: ">=2.17.0-182.2.beta <3.0.0".

how can I use flutter_test from sdk and the package test? what version of test uses test_api 0.4.3?

I am trying to run some basic unit test for my flutter app. But when I run pub get I get the following error after including test: 1.20.0 in my pubspec:
dev_dependencies:
dependency_validator: ^3.1.0 # run flutter pub run dependency_validator
#integration_test:
# sdk: flutter
flutter_test:
sdk: flutter
test: ^1.20.0
so when I run f pub get I see:
Because test >=1.20.0 depends on test_api 0.4.9 and every version of flutter_test from sdk depends on test_api 0.4.3, test >=1.20.0 is incompatible with flutter_test from sdk.
So, because myapp depends on both flutter_test from sdk and test ^1.20.0, version solving failed.
pub get failed (1; So, because myapp depends on both flutter_test from sdk and test ^1.20.0, version solving failed.)```
What version of test uses test_api 0.4.3?
Try overriding test_api to 0.4.9 in your pubspec.yaml file:
dependency_overrides:
test_api: 0.4.9
or
dependency_overrides:
analyzer: ^3.0.0
You can probably remove this next time flutter updates.
I can just use import 'package:flutter_test/flutter_test.dart'; instead of importing directly from the test package in my test file. So I don't need to include test: 1.20.0 in my pubspec.
Add test_api in dependency_overrides
example:
dependency_overrides:
test_api: ^0.4.17
dev_dependencies:
flutter_test:
sdk: flutter
bloc_test: ^9.1.0
build_runner: ^2.3.3

Flutter path_provider and sdk version mismatch

The current Dart SDK version is 2.10.5.
Because path_provider 2.0.1 requires SDK version >=2.12.0-259.9.beta <3.0.0 and no versions of path_provider match >2.0.1 <3.0.0, path_provider ^2.0.1 is forbidden.
So, because harmonoid depends on path_provider ^2.0.1, version solving failed.
pub get failed (1; So, because harmonoid depends on path_provider ^2.0.1, version solving failed.)
How do i solved this error? this is my pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.8.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
animations: ^1.1.2
provider: ^4.3.3
assets_audio_player:
git: https://github.com/alexmercerind/Flutter-AssetsAudioPlayer
media_metadata_retriever: ^0.0.2+1
http: ^0.12.2
path: ^1.7.0
path_provider: ^2.0.1
flutter_local_notifications: ^3.0.3
url_launcher: ^5.5.0
permission_handler: ^5.0.1+1
share: ^0.6.5+4
palette_generator: ^0.2.3
implicitly_animated_reorderable_list: ^0.3.2
dev_dependencies:
flutter_test:
sdk: flutter
error
My Dart SDK version is 2.12.0, and the Flutter version is 2.0.1. I created a new project and copied all your dependencies. The project worked without any problems.
For saving your time, I recommend upgrading to the stable channel and Flutter 2 using these commands or this link.
flutter channel stable
flutter upgrade
If you don't want to migrate your Flutter and Dard SDK versions yet,
I would recommend you to try and remove the version from the line:
path_provider: ^2.0.1
so it would look like this: path_provider:
run: pub get again
run your project again
Eventually I would recomment to migrate to the newest version of the SDKs and upgrade all your dependencies. This is just a temporary solution.

Flutter theme version solving failed

I am trying to run a flutter theme code in visual studio code and facing this issue after running command (flutter run)
Because every version of flutter_test from sdk depends on vector_math 2.1.0-nullsafety.5 and fstore depends on vector_math 2.0.8, flutter_test from sdk is forbidden.
So, because fstore depends on flutter_test any from sdk, version solving failed.
Running "flutter pub get" in ecomputex...
pub get failed (1; So, because fstore depends on flutter_test any from sdk, version solving failed.)
Please helpenter image description here
just add this line of code in your pubspec
dependency_overrides:
vector_math: 2.1.0-nullsafety.5
this will override the dependency, and you can use whatever version you want. you might need to change it the version of the package.
my code example:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
file_picker: ^3.0.0
hive: ^2.0.0
hive_flutter: ^1.0.0
dependency_overrides:
path_provider: 2.0.1

Install package during pub get?

During the installation fo mongo_dart 0.4.3 I received the following error (pub get)
Because every version of flutter_test from sdk depends on crypto 2.1.4 and mongo_dart >=0.4.1-dev.2.2 depends on crypto ^2.1.5, flutter_test from sdk is incompatible with mongo_dart >=0.4.1-dev.2.2.
So, because fluttermongo depends on both mongo_dart ^0.4.3 and flutter_test any from sdk, version solving failed.
pub get failed (1; So, because fluttermongo depends on both mongo_dart ^0.4.3 and flutter_test any from sdk, version solving failed.)
Process finished with exit code 1
my pubspec.yaml:
name: fluttermongo
description: A new Flutter application.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
mongo_dart: ^0.4.3
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
dependency_overrides:
path: 1.6.4
flutter:
uses-material-design: true
What am I missing ? how can I sove it ?
from
flutter_test from sdk depends on crypto 2.1.4 and mongo_dart >=0.4.1-dev.2.2 depends on crypto ^2.1.5,
downgrade your fluttermongo version. check to see that it supports crypto 2.1.4