flutter/flutter

[tool_crash] FileSystemException: Cannot open file, OS Error: The process cannot access the file because the file is occupied by another process., errno = 32

Vlados8 opened this issue · 2 comments

Command

flutter --no-color run --machine --track-widget-creation --device-id=windows --start-paused --dart-define=flutter.inspector.structuredErrors=true lib\main.dart

Steps to Reproduce

  1. ...
  2. ...
  3. ...

Logs

FileSystemException: Cannot open file, OS Error: Процесс не может получить доступ к файлу, так как этот файл занят другим процессом.
, errno = 32

#0      _checkForErrorResponse (dart:io/common.dart:55:9)
#1      _File.open.<anonymous closure> (dart:io/file_impl.dart:381:7)
#2      _rootRunUnary (dart:async/zone.dart:1407:47)
#3      _CustomZone.runUnary (dart:async/zone.dart:1308:19)
<asynchronous suspension>
#4      _File.writeAsBytes.<anonymous closure> (dart:io/file_impl.dart:634:34)
<asynchronous suspension>
#5      ForwardingFile.writeAsString (package:file/src/forwarding/forwarding_file.dart:136:12)
<asynchronous suspension>
#6      ErrorHandlingFile.writeAsString.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:246:24)
<asynchronous suspension>
#7      _run (package:flutter_tools/src/base/error_handling_io.dart:556:12)
<asynchronous suspension>
#8      _renderTemplateToFile (package:flutter_tools/src/flutter_plugins.dart:38:3)
<asynchronous suspension>
#9      _writeCppPluginRegistrant (package:flutter_tools/src/flutter_plugins.dart:852:3)
<asynchronous suspension>
#10     writeWindowsPluginFiles (package:flutter_tools/src/flutter_plugins.dart:847:3)
<asynchronous suspension>
#11     injectPlugins (package:flutter_tools/src/flutter_plugins.dart:1089:5)
<asynchronous suspension>
#12     FlutterProject.ensureReadyForPlatformSpecificTooling (package:flutter_tools/src/project.dart:386:5)
<asynchronous suspension>
#13     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1736:7)
<asynchronous suspension>
[✓] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.19045.4291], locale ru-RU)
    • Flutter version 3.22.0 on channel stable at C:\Flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (8 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

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

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\Vlad\AppData\Local\Android\sdk
    • Platform android-34, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11572160)
    • 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.9.0)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.9.31025.194
    • Windows 10 SDK version 10.0.19041.0

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

[✓] VS Code (version 1.89.1)
    • VS Code at C:\Users\Vlad\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.88.0

[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.4291]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 125.0.6422.61
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 124.0.2478.105

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

• No issues found!

Flutter Application Metadata

Type: app
Version: 1.0.0+1
Material: true
Android X: false
Module: false
Plugin: false
Android package: null
iOS bundle identifier: null
Creation channel: stable
Creation framework version: 5dcb86f

Similar issue: #139746

@Vlados8
Can you try this and confirm if it helps or not ?