Ansharja
Ansharja

Reputation: 1123

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?

Upvotes: 0

Views: 1220

Answers (2)

Md Shahnawaz
Md Shahnawaz

Reputation: 584

Update your latest collection plugin

dependencies:
 collection: ^1.14.13

Upvotes: 0

Ovidiu
Ovidiu

Reputation: 8714

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

Upvotes: 2

Related Questions