Skip to content

Flutter upgrade ko for .pub-cache folder #128635

@oznecniV97

Description

@oznecniV97

Is there an existing issue for this?

Steps to reproduce

  1. Install an older flutter version (E.g. 3.10.3)
  2. run flutter pub get command inside a flutter project with dependencies
  3. run flutter upgrade command

Expected results

The upgrade starts without error and upgrade flutter to latest stable version ignoring (or deleting?) .pub-cache/ folder.

Actual results

The upgrade process was stopped by git check, because a change inside local repository was found.

$ flutter upgrade
Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is recommended that you stash them via "git stash" or else commit the changes to a local branch.
If it is okay to remove local changes, then re-run this command with "--force".

The problem is related to .pub-cache/ folder inside flutter directory:

~/snap/flutter/common/flutter$ git status
On branch stable
Your branch is behind 'origin/stable' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	.pub-cache/

nothing added to commit but untracked files present (use "git add" to track)

Code sample

No code related issue

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
$ flutter doctor -v

┌─────────────────────────────────────────────────────────┐
│ A new version of Flutter is available!                  │
│                                                         │
│ To update to the latest version, run "flutter upgrade". │
└─────────────────────────────────────────────────────────┘
[✓] Flutter (Channel stable, 3.10.3, on Ubuntu 22.04.2 LTS 5.19.0-43-generic, locale en_US.UTF-8)
    • Flutter version 3.10.3 on channel stable at /home/vincenzosalerno/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f92f44110e (8 days ago), 2023-06-01 18:17:33 -0500
    • Engine revision 2a3401c9bb
    • Dart version 3.0.3
    • DevTools version 2.23.1

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


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

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] IntelliJ IDEA Community Edition (version 2023.1)
    • IntelliJ at /snap/intellij-idea-community/434
    • Flutter plugin version 74.0.4
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.78.2)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.2 LTS 5.19.0-43-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 114.0.5735.106

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Metadata

Metadata

Labels

found in release: 3.10Found to occur in 3.10found in release: 3.12Found to occur in 3.12has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions