Dependencies error 1 not solivng problem google_maps - flutter

I'm trying to upgrade all the dependencies, but this error is still shown. I have tried to override them but shows a no privileges error. I already tried to run flutter pub cache repair, flutter pub get, and not sure if I need to delete the cache or maybe reinstall flutter in another file, please any suggest could help.
Because google_map_polyline >=0.0.4 <0.2.0 depends on google_maps_flutter ^0.5.21+4 and google_map_polyline <0.0.4 depends on google_maps_flutter ^0.5.19+2, google_map_polyline <0.2.0 requires google_maps_flutter ^0.5.19+2.
And because google_map_polyline >=0.2.0 depends on google_maps_flutter ^0.5.21+6, every version of google_map_polyline requires google_maps_flutter ^0.5.19+2.
So, because fletgo_user_app depends on both google_maps_flutter ^2.1.0 and google_map_polyline any, version solving failed.
pub get failed (1; So, because fletgo_user_app depends on both google_maps_flutter ^2.1.0 and google_map_polyline any, version solving failed.)
Process finished with exit code 1

The error appears because google_map_polyline is set to 'any'. But the real problem appear because google_map_polyline is already discontinued.
I suggest you change the library and migrate using the flutter_polyline_points

Related

Package incompatibility - Flutter

How to solve this error?
Because no versions of flutter_local_notifications match >11.0.0 <12.0.0 and flutter_local_notifications 11.0.0 depends on flutter_local_notifications_linux ^1.0.0, flutter_local_notifications ^11.0.0 requires flutter_local_notifications_linux ^1.0.0.
And because no versions of flutter_local_notifications_linux match >1.0.0 <2.0.0 and flutter_local_notifications_linux 1.0.0 depends on dbus ^0.7.1, flutter_local_notifications ^11.0.0 requires dbus ^0.7.1.
Because dbus >=0.7.4 depends on xml ^6.1.0 and dbus >=0.2.0 <0.7.4 depends on xml ^5.0.0, dbus >=0.2.0 requires xml ^5.0.0 or ^6.1.0.
Thus, flutter_local_notifications ^11.0.0 requires xml ^5.0.0 or ^6.1.0.
And because excel >=1.0.4 <2.0.0-null-safety depends on xml ^4.1.0, flutter_local_notifications ^11.0.0 is incompatible with excel >=1.0.4 <2.0.0-null-safety.
So, because sambo_school_app depends on both excel ^1.1.5 and flutter_local_notifications ^11.0.0, version solving failed.
pub get failed (1; So, because sambo_school_app depends on both excel ^1.1.5 and flutter_local_notifications ^11.0.0, version solving failed.)
exit code 1
Flutter packages can use the same dependencies. So when you have two packages that do not use the same versions of the dependency in question you will get the message you have in your question. To solve this you have two possibilities:
Increase or decrease the version of one or both packages to find two versions that are compatible
Look for another package that performs the same task if the package you are using has been discontinued for several years and because of this they are using too old dependencies
You can update your Flutter sdk or if you do not want to update the Sdk then find the one package version that matches your dart version on pub dev version tab on this package doc page on pub dev. Like minimum sdk for flutter_local_notifications version 11.0.0 is 2.15.
https://pub.dev/packages/flutter_local_notifications/versions

fluttermaps depends on search_map_place ^0.3.0, version solving failed

I am trying to add Google Maps in Flutter but, I am getting this kind of error so, can you guys help me solve it.
Because search_map_place >=0.3.0 depends on http ^0.12.0+4 and fluttermaps depends on http ^0.13.5, search_map_place >=0.3.0 is forbidden.
So, because fluttermaps depends on search_map_place 0.3.0, version solving failed.
pub get failed (1; So, because fluttermaps depends on search_map_place 0.3.0, version solving failed.)
Remove the version numbers in pubspec.yaml
just put it like
search_map_place:
http:
and run pub get

Flutter dependency conflict (versions depend on another )

I want to add avtar in my App but not able to do this because of dependency conflict/ required version error. I also trying to override dependency but its still not working. also trying this commands.
Flutter clean
Flutter pub get
But still not working.
ERROR:-
Because no versions of random_avatar match >0.0.7 <0.1.0 and random_avatar 0.0.7 depends on flutter_svg ^1.0.3, random_avatar ^0.0.7 requires flutter_svg ^1.0.3.
And because flutter_html >=2.0.0-nullsafety.1 <3.0.0-alpha.1 depends on flutter_svg >=0.22.0 <1.0.0, random_avatar ^0.0.7 is incompatible with flutter_html >=2.0.0-nullsafety.1 <3.0.0-alpha.1.
So, because seedwill_demo depends on both flutter_html ^2.2.1 and random_avatar ^0.0.7, version solving failed.
pub get failed (1; So, because seedwill_demo depends on both flutter_html ^2.2.1 and random_avatar ^0.0.7, version solving failed.)
I guess You working on Flutter 2, but Flutter 3 is released. On pub, some libraries are default compatible with Flutter 3. In this case, not always newest library is the best option. You must find which library is incompatible. Can You put pubspec.yaml to this post? We need TWO version of pubspec.yaml. Previous (which have no error with pub get) and new, with this new library. If You show them, I try find the best version of library for You.
I had problems that look alike, and somehow managed to eliminate them by upgrading flutter parts (updating or reinstalling). Have you tried following commands?
flutter clean
flutter upgrade
flutter pub upgrade

Conflict between dependencies when adding a new one

These were my dependencies in my pubspec.yaml:
dependencies:
...
image_picker: ^0.8.4+2
...
And everything worked fine, but now I added this:
dependencies:
...
image_picker: ^0.8.4+2
...
image_editor_pro: ^1.1.8
And running pub get I have this error:
Because image_editor_pro >=1.1.0 depends on image_picker ^0.7.4 and provauth depends on image_picker ^0.8.4+2, image_editor_pro >=1.1.0 is forbidden.
So, because provauth depends on image_editor_pro ^1.1.8, version solving failed.
pub get failed (1; So, because provauth depends on image_editor_pro ^1.1.8, version solving failed.)
I tried downgrading my version of image_picker but I get a new error:
Cannot open file, path = 'C:\Users\loren\flutter.pub-cache_temp\dir60565baa\test\fixtures\invalid\n_structure_<.>.json' (OS Error: Syntax of the name of the file, of the directory or of volume is not correct (This is my bad translation of the error).
, errno = 123)
pub get failed (66; , errno = 123))
What can I do to solve and use both the dependencies?
You can try to override the dependency so only one version is used for your project. Something like this:
name: your_app
dependencies:
image_picker: ^0.8.4+2
image_editor_pro: ^1.1.8
dependency_overrides:
image_picker: '0.8.4+2' # Use only this version for all the code depended on image picker
But you need to thoroughly tested the library that depends on the overrided dependency to check if it not introducing you a new error.
See https://dart.dev/tools/pub/dependencies#dependency-overrides
Seems like there is a conflict with image_editor_pro because the package is old.
It is better to look for another updated package with null safety, like image_editor 1.0.2, this won't have conflictions with image_picker 0.8.4+1.
And if you are willing to downgrade. ## Downgrading is a pain
You might need to downgrade the other dependencies as well. which might lead to Downgrading the Dart version.
After downgrading execute this command:
flutter clean
Then delete pubspec.lock file.
If a conflict between dependencies occurs, the simplest solution is to remove the version numbers of the two dependencies and then replace them with 'any' without the quotes in front of it. Then run pub get.
Hope you can help

Flutter easy_localization and intl version solving failed

I'm getting this error after updating flutter to version 1.25.0-8.1.pre-
Because `easy_localization` >=2.1.0+1 depends on `flutter_localizations` any from sdk which depends on `intl` 0.17.0-nullsafety.2, `easy_localization` >=2.1.0+1 requires `intl` 0.17.0-nullsafety.2.
So, because news_app depends on both `easy_localization` ^2.3.3 and `intl` ^0.16.1, version solving failed.
pub get failed (1; So, because news_app depends on both `easy_localization` ^2.3.3 and `intl` ^0.16.1, version solving failed.)
I have easy_localization 2.3.3, intl 0.16.0 and dart 2.12.0 installed. Please help
Basically what's happening is easy_localization uses a package which uses a newer version of intl. Basically, you're asking the package manager to handle two versions of the same package, there are two solutions.
Downgrade easy_localization package to a version which uses the same intl version (not recommended)
Upgrade your intl version to 0.17.0-nullsafety.2 (recommended, but null safecty is still in beta so you have to be aware of that)
Have a good day!
I think this is the best way to solve this,
You need to switch your flutter channel to a stable version, by running
flutter channel stable
in the command line. This will switch your channel to a stable version and will get rid of the error.
I hope this best solves your issue.