Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter upgrade fails because a file is locked from another process (flutter on android studio iguana) #145107

Closed
RoarGronmo opened this issue Mar 13, 2024 · 2 comments
Labels
r: duplicate Issue is closed as a duplicate of an existing issue

Comments

@RoarGronmo
Copy link

Whenever upgrading with "flutter upgrade" or "flutter upgrade --force" in flutter channel main, the upgrade process fails with following message, which seems recursive:

PS C:\FlutterProjects\mOffice> flutter upgrade
Upgrading Flutter to 3.21.0-7.0.pre.11 from 3.21.0-4.0.pre.22 in c:\Flutter\flutter...
Checking Dart SDK version... 
Downloading Dart SDK from Flutter engine 6ceccf894c41a28f01e953379078b13e008d9d84... 
Rename-Item : Prosessen f�r ikke tilgang til filen fordi den brukes av en annen
 prosess.
At C:\Flutter\flutter\bin\internal\update_dart_sdk.ps1:74 char:9
+         Rename-Item $dartSdkPath "$oldDartSdkPrefix$oldDartSdkSuffix"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Flutter\flutter\bin\cache\dart-s
   dk:String) [Rename-Item], IOException
    + FullyQualifiedErrorId : RenameItemIOError,Microsoft.PowerShell.Commands.
   RenameItemCommand

Error: Unable to update Dart SDK. Retrying... 
ERROR: Input redirection is not supported, exiting the process immediately.
Checking Dart SDK version... 
Downloading Dart SDK from Flutter engine 6ceccf894c41a28f01e953379078b13e008d9d84...
Rename-Item : Prosessen f�r ikke tilgang til filen fordi den brukes av en annen
 prosess.
At C:\Flutter\flutter\bin\internal\update_dart_sdk.ps1:74 char:9
+         Rename-Item $dartSdkPath "$oldDartSdkPrefix$oldDartSdkSuffix"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Flutter\flutter\bin\cache\dart-s
   dk:String) [Rename-Item], IOException
    + FullyQualifiedErrorId : RenameItemIOError,Microsoft.PowerShell.Commands.
   RenameItemCommand

Error: Unable to update Dart SDK. Retrying... 
ERROR: Input redirection is not supported, exiting the process immediately.
Checking Dart SDK version... 
Downloading Dart SDK from Flutter engine 6ceccf894c41a28f01e953379078b13e008d9d84...
Rename-Item : Prosessen f�r ikke tilgang til filen fordi den brukes av en annen
 prosess.
At C:\Flutter\flutter\bin\internal\update_dart_sdk.ps1:74 char:9
+         Rename-Item $dartSdkPath "$oldDartSdkPrefix$oldDartSdkSuffix"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Flutter\flutter\bin\cache\dart-s
   dk:String) [Rename-Item], IOException
    + FullyQualifiedErrorId : RenameItemIOError,Microsoft.PowerShell.Commands.
   RenameItemCommand

Error: Unable to update Dart SDK. Retrying...
ERROR: Input redirection is not supported, exiting the process immediately.
Checking Dart SDK version... 
Downloading Dart SDK from Flutter engine 6ceccf894c41a28f01e953379078b13e008d9d84...
Rename-Item : Prosessen f�r ikke tilgang til filen fordi den brukes av en annen
 prosess.
At C:\Flutter\flutter\bin\internal\update_dart_sdk.ps1:74 char:9
+         Rename-Item $dartSdkPath "$oldDartSdkPrefix$oldDartSdkSuffix"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Flutter\flutter\bin\cache\dart-s
   dk:String) [Rename-Item], IOException
    + FullyQualifiedErrorId : RenameItemIOError,Microsoft.PowerShell.Commands.
   dk:String) [Rename-Item], IOException
    + FullyQualifiedErrorId : RenameItemIOError,Microsoft.PowerShell.Commands.
   RenameItemCommand

Error: Unable to update Dart SDK. Retrying...
ERROR: Input redirection is not supported, exiting the process immediately.
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 6ceccf894c41a28f01e953379078b13e008d9d84...
Terminate batch job (Y/N)? y
PS C:\FlutterProjects\mOffice>

Only remedy seems to stop Android Studio, restart it and check channel wih flutter channel, this seems to reinit and reload the channel:

PS C:\FlutterProjects\mOffice> flutter channel                                         
Waiting for another flutter command to release the startup lock...
Flutter channels:
  master (latest development branch, for contributors)
* main (latest development branch, follows master channel)
  beta (updated monthly, recommended for experienced users)
  stable (updated quarterly, for new users and for production app releases)
PS C:\FlutterProjects\mOffice> 

Checking it again with flutter doctor -v seems to give the correct (latest) update:

PS C:\FlutterProjects\mOffice> flutter doctor -v
[√] Flutter (Channel main, 3.21.0-7.0.pre.11, on Microsoft Windows [Version 10.0.22631.3296], locale nb-NO)
    • Flutter version 3.21.0-7.0.pre.11 on channel main at c:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 122849311f (77 minutes ago), 2024-03-13 14:12:59 -0400
    • Engine revision 6ceccf894c
    • Dart version 3.4.0 (build 3.4.0-227.0.dev)
    • DevTools version 2.33.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\roarg\AppData\Local\Android\Sdk
    • Platform android-VanillaIceCream, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\roarg\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android Studio\Android Studio 2023.3.1.13\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11446219)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31702.278
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2022.3.1.22
    • 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 17.0.6+0-b2043.56-10027231)

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.1.1.28
    • 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 17.0.7+0-b2043.56-10550314)

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.2.1.23
    • 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 17.0.9+0--11185874)

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.1.1.22
    • 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 17.0.7+0-b2043.56-10550314)

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.2.1.20
    • 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 17.0.9+0--11185874)

[√] Android Studio (version 2023.3)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2023.3.1.13
    • 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 17.0.10+0--11446219)

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.3296]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 122.0.6261.112
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 122.0.2365.80

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

• No issues found!
PS C:\FlutterProjects\mOffice> 

Is there a known issue with this file locking situation, or may it be an Anti Virus issue ? (using Windows Defender)

Have seen similar issues with stable channel and beta channel too...

Same behavior on my home office computer and work office computer (both latest Windows 11, home 16GB, work 32GB, both Core i7).

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Mar 14, 2024
@darshankawar
Copy link
Member

Closing this as duplicate of #114753

@darshankawar darshankawar closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2024
@darshankawar darshankawar added r: duplicate Issue is closed as a duplicate of an existing issue and removed in triage Presently being triaged by the triage team labels Mar 14, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: duplicate Issue is closed as a duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

2 participants