plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Bug]: flutter pub add installs wrong version of [package_info_plus]

Open innomatica opened this issue 3 years ago • 2 comments

Platform

Platform independent

Plugin

package_info_plus

Version

1.4.2

Flutter SDK

3.0.3

Steps to reproduce

  1. Create a new app
  2. Run flutter pub add path_provider
  3. Run flutter pub add package_info_plus
  4. Check the version of package_info_plus package installed

flutter pub add <package> installs wrong version of the app in certain cases, presumably related to the ffi version. If you do the step 3 before the step 2, you will get the following output, which is expected:

Resolving dependencies...
  async 2.8.2 (2.9.0 available)
  characters 1.2.0 (1.2.1 available)
  clock 1.1.0 (1.1.1 available)
  fake_async 1.3.0 (1.3.1 available)
+ ffi 1.2.1 (2.0.1 available)
+ flutter_web_plugins 0.0.0 from sdk flutter
+ http 0.13.4
+ http_parser 4.0.1
+ js 0.6.4
  matcher 0.12.11 (0.12.12 available)
  material_color_utilities 0.1.4 (0.1.5 available)
  meta 1.7.0 (1.8.0 available)
+ package_info_plus 1.4.2
+ package_info_plus_linux 1.0.5
+ package_info_plus_macos 1.3.0
+ package_info_plus_platform_interface 1.0.2
+ package_info_plus_web 1.0.5
+ package_info_plus_windows 1.0.5
  path 1.8.1 (1.8.2 available)
+ plugin_platform_interface 2.1.2
  source_span 1.8.2 (1.9.0 available)
  string_scanner 1.1.0 (1.1.1 available)
  term_glyph 1.2.0 (1.2.1 available)
  test_api 0.4.9 (0.4.11 available)
+ typed_data 1.3.1
+ win32 2.6.1 (2.7.0 available)
Changed 14 dependencies!

However if you do it after the step 2 as described, you get

Resolving dependencies...
  async 2.8.2 (2.9.0 available)
  characters 1.2.0 (1.2.1 available)
  clock 1.1.0 (1.1.1 available)
  fake_async 1.3.0 (1.3.1 available)
  matcher 0.12.11 (0.12.12 available)
  material_color_utilities 0.1.4 (0.1.5 available)
  meta 1.7.0 (1.8.0 available)
+ package_info_plus 0.0.1 (1.4.2 available)
  path 1.8.1 (1.8.2 available)
  source_span 1.8.2 (1.9.0 available)
  string_scanner 1.1.0 (1.1.1 available)
  term_glyph 1.2.0 (1.2.1 available)
  test_api 0.4.9 (0.4.11 available)
Changed 1 dependency!

You can manually edit pubspec.yaml

dependencies:
  ...
  package_info_plus: ^1.4.2

Then you can run flutter pub get without any issue.

Code Sample

No response

Logs

Output from `flutter pub add -v package_info_plus` is too big to fit here. But you can generate it very easily.

Flutter Doctor

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.0.3, on Fedora Linux 36 (Workstation Edition) 5.18.6-200.fc36.x86_64, locale en_CA.UTF-8)
    • Flutter version 3.0.3 at /home/innomatic/.local/share/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 676cefaaff (7 days ago), 2022-06-22 11:34:49 -0700
    • Engine revision ffe7b86a1e
    • Dart version 2.17.5
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /home/innomatic/Android/Sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /home/innomatic/.local/share/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 14.0.0 (Fedora 14.0.0-1.fc36)
    • cmake version 3.22.2
    • ninja version 1.10.2
    • pkg-config version 1.8.0

[✓] Android Studio (version 2021.2)
    • Android Studio at /home/innomatic/.local/share/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.68.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.42.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Fedora Linux 36 (Workstation Edition) 5.18.6-200.fc36.x86_64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 103.0.5060.53

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

innomatica avatar Jun 29 '22 15:06 innomatica

Same problem, I was trying to install package_info_plus and I always get version 0.0.1 In my case I had to delete these packages (shared_preferences, connectivity_plus), then I tried to install package_info_plus which I got with the correct version. After that I re-installed the two deleted packages, which were added to the same previous versions.

Francesco-FL avatar Jul 06 '22 01:07 Francesco-FL

Any news please ?

yacineblr avatar Jul 19 '22 08:07 yacineblr

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Feb 06 '23 00:02 github-actions[bot]