dependencies fail to install on Codemagic - flutter

I am trying to build a flutter app on Codemagic but the build fails when installing dependencies. I have upgraded all dependencies in the pubspec.yaml file but I get the message below in Codemagic:
> flutter packages pub get
== Install Flutter dependencies ==Resolving dependencies...
The current Dart SDK version is 2.13.0.
Because test >=1.16.0-nullsafety <1.16.0-nullsafety.8 requires SDK version >=2.10.0-0 <2.12.0 and test >=1.16.0-nullsafety.8 <1.16.0-nullsafety.18 depends on typed_data >=1.3.0-nullsafety <1.3.0, test >=1.16.0-nullsafety <1.16.0-nullsafety.18 requires typed_data >=1.3.0-nullsafety <1.3.0.
And because test >=1.16.0-nullsafety.18 <1.16.0-nullsafety.19 depends on test_api 0.2.19-nullsafety.7, test >=1.16.0-nullsafety <1.16.0-nullsafety.19 requires typed_data >=1.3.0-nullsafety <1.3.0 or test_api 0.2.19-nullsafety.7.
And because test >=1.15.5 <1.16.0-nullsafety depends on test_api 0.2.18+1 and test >=1.16.0-nullsafety.19 <1.16.6 depends on test_api 0.2.19, test >=1.15.5 <1.16.6 requires typed_data >=1.3.0-nullsafety <1.3.0 or test_api 0.2.18+1 or 0.2.19-nullsafety.7 or 0.2.19.
And because every version of flutter_test from sdk depends on both typed_data 1.3.0 and test_api 0.3.0, flutter_test from sdk is incompatible with test >=1.15.5 <1.16.6.
And because test >=1.16.6 depends on yaml ^3.0.0 and flutter_launcher_icons 0.8.1 depends on yaml ^2.1.15, one of flutter_test any from sdk or test >=1.15.5 or flutter_launcher_icons 0.8.1 must be false.
And because no versions of flutter_launcher_icons match >0.8.1 <0.9.0 and tonnah depends on flutter_launcher_icons ^0.8.1, flutter_test from sdk is incompatible with test >=1.15.5.
So, because tonnah depends on both test ^1.15.7 and flutter_test any from sdk, version solving failed.
pub finished with exit code 1
Build failed :|
Failed to install dependencies
I have made a lot of changes to the code so I don't know where to start to look for a solution. I am not running any tests in Codemagic.
This is from flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.5, on Microsoft Windows [Version
10.0.19041.985], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.56.2)
[√] Connected device (3 available)

Related

integration_test Depends on Old Version of test_api (0.4.3) - How Can I Upgrade?

I'm trying to keep all my dependencies up to date, but integration_test and flutter_test seem to depend on test_api 0.4.3, and won't accept versions higher than this. I've had this problem for several months. I've watched several Flutter versions roll by. Each time, I think it will be fixed, and the problem remains. I currently have installed
Flutter 2.8.1 • channel stable
The current version of test is 1.20.1 but if I try to use the latest package, I get this error when I do a flutter pub get
Because test >=1.20.0 depends on test_api 0.4.9 and every version of integration_test from sdk depends on test_api 0.4.3, test >=1.20.0 is incompatible with
integration_test from sdk.
So, because assets_app depends on both integration_test from sdk and test ^1.20.1, version solving failed.
I checked out the package on GitHub for integration_test and as you can see, it points to 0.4.9 of test_api. So, the only thing I can think of is that the current Flutter SDK points to an older version of integration_test.
It looks as though test is generally outdated because if I try to upgrade analyzer, I get this:
Because every version of flutter_test from sdk depends on test_api 0.4.3 and test >=1.20.0 depends on test_api 0.4.9, flutter_test from sdk is incompatible with test >=1.20.0.
And because test >=1.17.10 <1.20.0 depends on analyzer >=1.0.0 <3.0.0 and test >=1.16.6 <1.17.10 depends on analyzer ^1.0.0, if flutter_test from sdk and test >=1.16.6 then analyzer >=1.0.0 <3.0.0.
And because test >=1.16.1 <1.16.6 depends on analyzer >=0.39.5 <2.0.0 and test >=1.16.0-nullsafety.10 <1.16.1 depends on analyzer >=0.36.0 <0.42.0, if flutter_test from sdk and test >=1.16.0-nullsafety.10 then analyzer >=0.36.0 <3.0.0.
And because test >=1.16.0-nullsafety <1.16.0-nullsafety.8 requires SDK version >=2.10.0-0 <2.12.0 and test <1.3.0 requires SDK version >=1.8.0 <2.0.0-∞, if flutter_test from sdk and test <1.3.0-∞ or >=1.16.0-nullsafety <1.16.0-nullsafety.8 or >=1.16.0-nullsafety.10 then analyzer >=0.36.0 <3.0.0.
And because test >=1.3.0 <1.16.0-nullsafety depends on yaml ^2.0.0 and test >=1.16.0-nullsafety.8 <1.16.0-nullsafety.12 depends on yaml ^2.0.0, if flutter_test from sdk and test any then analyzer >=0.36.0 <3.0.0 or yaml ^2.0.0.
And because assets_app depends on analyzer ^3.2.0 which depends on yaml ^3.0.0, flutter_test from sdk is incompatible with test.
So, because assets_app depends on both flutter_test from sdk and test any, version solving failed.
How can we upgrade integration_test so that we can also use test_api 0.4.9, and test 1.20.1 ?
Flutter pins it's dependencies. That's it. You have two options.
Wait for the next flutter release that has a version pin that you want
add a dependency override to get the latest version
In my case the problem was with the integration_test package
Accessing the flutter eintegration test package via cli , you can update the dependencies.
pubspec.yaml in integration_test contains this in every package you can update.
archive: 3.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
So I ran "flutter update-packages --force-upgrade"
He updated the conflict and I had no more problems.

Flutter pub get version solving failed

I'm getting this issue with flutter pub get, tried to update the dart sdk, restart the pc to add the Dart sdk location back to the environment variables, delete the .git folder.
Running "flutter pub get" in calculator...
The current Dart SDK version is 2.13.4.
Because calculator depends on webview_flutter >=2.0.14 which requires SDK version >=2.14.0 <3.0.0, version solving failed.
pub get failed (1; Because calculator depends on webview_flutter >=2.0.14 which requires SDK version >=2.14.0 <3.0.0, version solving failed.)
exit code 1
Flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [version 10.0.19043.1288], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] VS Code (version 1.61.2)
[√] Connected device (3 available)
Dart Version:
Dart SDK version: 2.14.4 (stable) (Wed Oct 13 11:11:32 2021 +0200) on "windows_x64"
Change version of webview_flutter in pubspec.yaml to
webview_flutter: any
When you say you tried updating the Dart SDK, did you update your pubspec.yaml as well?
environment:
sdk: ">=2.14.0 <3.0.0"
Try deleting pubspec.lock and try again
try
flutter upgrade
it worked for me.
I solved the problem after updating Dart Sdk and restarting the pc.
Even after these two steps I still got the same error, so I put any in the package value in pubspec.yaml and before running flutter pub get, I turned off my antivirus.
just put your dependency without version
dependencies:
flutter:
sdk: flutter
file_picker: #put your conflicting dependency as without version

Flutter: no versions of permission_handler match >5.1.0+2 <6.0.0

After upgrading Flutter and Dart to the latest versions I also updated the dependencies of my app. Now, when I run flutter pub get I get the following error:
Because no versions of permission_handler match >5.1.0+2 <6.0.0 and permission_handler 5.1.0+2 depends on permission_handler_platform_interface ^2.0.2, permission_handler ^5.1.0+2 requires permission_handler_platform_interface ^2.0.2.
And because no versions of permission_handler_platform_interface match >2.0.2 <3.0.0 and permission_handler_platform_interface 2.0.2 depends on plugin_platform_interface ^1.0.2, permission_handler ^5.1.0+2 requires plugin_platform_interface ^1.0.2.
And because geolocator >=7.0.0 depends on geolocator_platform_interface ^2.0.0 which depends on plugin_platform_interface ^2.0.0, permission_handler ^5.1.0+2 is incompatible with geolocator >=7.0.0.
So, because MyApp depends on both geolocator ^7.0.1 and permission_handler ^5.1.0+2, version solving failed.
Running "flutter pub get" in flutter_app...
pub get failed (1; So, because MyApp depends on both geolocator ^7.0.1 and permission_handler ^5.1.0+2, version solving failed.)
I do not quite understand where the error is and what I can do to fix it. If there is any information missing, I will add it as soon as I can. Does anyone have an idea what I need to change in the dependencies?
Here is my flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.19042.804], locale de-DE)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] IntelliJ IDEA Ultimate Edition (version 2020.3)
[√] Connected device (3 available)
• No issues found!
That’s because this package doesn’t support null safety yet. I think you should rather create an issue on their GitHub repository instead of asking the question here.

Dart SDK version mismatch while installing build_runner

I'm trying to add build_runner: ^1.10.2 to dev_dependencies in the pubspec.yaml file, but I am getting the following error:
The current Dart SDK version is 2.9.0.
Because project_name depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed.
pub get failed (1; Because project_name depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed.)
I checked the dart website and the latest version of Dart SDK is 2.9.0 while 2.10 is still in dev.
Here's my flutter doctor output:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.1, on Microsoft Windows [Version 10.0.18362.959], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 4.0)
[√] VS Code, 64-bit edition (version 1.39.2)
[√] Connected device (1 available)
• No issues found!
This is an issue with the latest releases of dart, analyzer, and flutter creating conflicts with each other, which you can read more about at this Github issue. There likely is no real issue with your configuration.
A temporary solution that I've seen is to use a dependency override of the analyzer:
dev_dependencies:
build_runner: ^1.10.0
dependency_overrides:
analyzer: 0.39.14
I encountered this problem after doing some cleaning up of my directories and having downloaded/installed the latest flutter. Bam. Then I realised that version of flutter sits by default on channel stable. After switching to master, it solved my problem, i.e.:
flutter channel master
flutter upgrade
As of September 28, 2020 the latest version of Flutter on stable channel no longer has this issue.
Use these commands to upgrade.
flutter channel stable
flutter upgrade

image_size_getter install error (Because every version of flutter_test from sdk depends on collection [...]) [flutter]

I'm trying to install image-size-getter on my flutter desktop project.
When i add this to my package's pubspec.yaml:
dependencies:
[...]
image_size_getter: ^0.1.0
i get this error:
Because every version of flutter_test from sdk depends on collection
1.14.11 and every version of image_size_getter depends on collection ^1.14.12, flutter_test from sdk is incompatible with
image_size_getter. So, because example_flutter depends on both
image_size_getter ^0.1.0 and flutter_test any from sdk, version
solving failed.
I tried to solve that issue by ovveriding dependencies as i found here and here (i must be on the futter master channel):
dependency_overrides:
flutter_test: ^1.14.12
But now it seems that flutter_test package is not available:
Because example_flutter depends on flutter_test any which doesn't
exist (could not find package flutter_test at
https://pub.dartlang.org), version solving failed. pub get failed
(server unavailable) -- attempting retry 1 in 1 second... Because
example_flutter depends on flutter_test any which doesn't exist (could
not find package flutter_test at https://pub.dartlang.org), version
solving failed. pub get failed (server unavailable) -- attempting
retry 2 in 2 seconds... Because example_flutter depends on
flutter_test any which doesn't exist (could not find package
flutter_test at https://pub.dartlang.org), version solving failed. pub
get failed (server unavailable) -- attempting retry 3 in 4 seconds...
[..]
I upgraded to last master channel version, this is my flutter doctor output:
PS C:\flutter\200229_flutter-desktop-embedding-master\example> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v1.15.4-pre.239, on Microsoft Windows [Versione 10.0.18362.657], locale it-IT)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.4.3)
[√] Android Studio (version 3.0)
[√] IntelliJ IDEA Ultimate Edition (version 2017.2)
[√] VS Code, 64-bit edition (version 1.42.1)
[√] Connected device (1 available)
No issues found!
How i can i solve my issue?
flutter_test is not a regular package that you can override the version for - it is a part of the Flutter SDK.
What you can do however is override the version of collection such that both flutter_test and image_size_getter use the same version and no longer conflict.
Try this:
dependency_overrides:
collection: ^1.14.12
Update your latest collection plugin
dependencies:
collection: ^1.14.13