Skip to content

Add solve-suggestions when failing to upgrade to latest version #3685

@maximveksler

Description

@maximveksler

Environment

  • Dart version (run dart --version): Dart SDK version: 2.18.5 (stable) (Tue Nov 22 15:47:29 2022 +0000) on "linux_x64"
  • OS kind and version (e.g. "Windows 10, version 1809" or "macOS 12.4"): Linux m-inspiron5567 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Are you using the Chinese community mirror or a corporate firewall? No.

Flutter Environment:

flutter --version
Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b8f7f1f986 (2 weeks ago) • 2022-11-23 06:43:51 +0900
Engine • revision 8f2221fbef
Tools • Dart 2.18.5 • DevTools 2.15.0

Problem

Bug

Running the following sequence of events would install firebase_core: ^0.4.2+2

flutter create bug
cd bug
flutter pub add -d mocktail --verbose > log_pubadd_dev.txt 2>&1
flutter pub add firebase_core google_sign_in --verbose > log_pubadd.txt 2>&1
m@m-inspiron5567:/tmp/bug$ cat pubspec.yaml | grep firebase_core                                       
  firebase_core: ^0.4.2+2

Works

Running the following sequence of events would install firebase_core: ^2.3.0

flutter create works
cd works
flutter pub add firebase_core google_sign_in --verbose > log_pubadd.txt 2>&1
flutter pub add -d mocktail --verbose > log_pubadd_dev.txt 2>&1
m@m-inspiron5567:/tmp/works$ cat pubspec.yaml | grep firebase_core                                       
  firebase_core: ^2.3.0

Debug

m@m-inspiron5567:/tmp$ diff /tmp/bug/pubspec.yaml /tmp/works/pubspec.yaml -Naur
--- /tmp/bug/pubspec.yaml       2022-12-07 11:28:01.468494250 +0200
+++ /tmp/works/pubspec.yaml     2022-12-07 11:29:39.281944992 +0200
@@ -1,4 +1,4 @@
-name: bug
+name: works
 description: A new Flutter project.
 
 # The following line prevents the package from being accidentally published to
@@ -36,8 +36,8 @@
   # The following adds the Cupertino Icons font to your application.
   # Use with the CupertinoIcons class for iOS style icons.
   cupertino_icons: ^1.0.2
-  firebase_core: ^0.4.2+2
-  google_sign_in: ^4.0.16
+  firebase_core: ^2.3.0
+  google_sign_in: ^5.4.2
 
 dev_dependencies:
   flutter_test:

Attached bug & works directories (with the verbose logs) for reference.

Expected behavior

The SLVR would produce the same package dependency graph, picking the lastest stable of each dependency.

Actual behavior

The SLVR picks the lowest possible version of firebase_core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-enhancementA request for a change that isn't a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions