flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.12k stars 27.43k forks source link

[tool_crash] FileSystemException: Creation of temporary directory failed, OS Error: Access is denied., errno = 5 #154497

Closed ogolaSospeter closed 1 month ago

ogolaSospeter commented 2 months ago

Command

flutter run

Steps to Reproduce

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

Logs

FileSystemException: Creation of temporary directory failed, OS Error: Access is denied. , errno = 5

#0      _Directory.createTempSync (dart:io/directory_impl.dart:170:7)
#1      ForwardingDirectory.createTempSync (package:file/src/forwarding/forwarding_directory.dart:28:21)
#2      LocalFileSystem.systemTempDirectory (package:flutter_tools/src/base/file_system.dart:236:46)
#3      ForwardingFileSystem.systemTempDirectory (package:file/src/forwarding/forwarding_file_system.dart:33:49)
#4      new ResidentRunner (package:flutter_tools/src/resident_runner.dart:1110:24)
#5      new HotRunner (package:flutter_tools/src/run_hot.dart:104:9)
#6      RunCommand.createRunner (package:flutter_tools/src/commands/run.dart:659:14)
<asynchronous suspension>
#7      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:798:35)
<asynchronous suspension>
#8      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1394:27)
<asynchronous suspension>
#9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#10     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#11     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9)
<asynchronous suspension>
#12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#13     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5)
<asynchronous suspension>
#14     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
<asynchronous suspension>
#15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
[✓] Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.19045.4842], locale en-US)
    • Flutter version 3.22.2 on channel stable at D:\Users\ogola\FlutterApps\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (3 months ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • 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 34.0.0)
    • Android SDK at C:\Users\capta\AppData\Local\Android\sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

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

[✓] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.8.0)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
    • Visual Studio Build Tools 2022 version 17.8.34309.116
    • Windows 10 SDK version 10.0.22621.0

[✓] Android Studio (version 2022.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.6+0-b2043.56-10027231)

[✓] Android Studio (version 2023.3)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • 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, 64-bit edition (version 1.85.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.94.0

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

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

! Doctor found issues in 1 category.

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: 761747bfc538b5af34aa0d3fac380f1bc331ec49

Plugins

path_provider-2.1.4 path_provider_android-2.2.10 path_provider_foundation-2.4.0 path_provider_linux-2.2.1 path_provider_windows-2.3.0 url_launcher-6.3.0 url_launcher_android-6.3.9 url_launcher_ios-6.3.1 url_launcher_linux-3.2.0 url_launcher_macos-3.2.0 url_launcher_web-2.3.3 url_launcher_windows-3.1.2

danagbemava-nc commented 2 months ago

Hi @ogolaSospeter, Do you get this error every time consistently upon running flutter run ? Can you check if temporary directory is read only instead of writeable ? If so, try making it writeable and re-run to check if it resolves the crash or not.

github-actions[bot] commented 1 month ago

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.

github-actions[bot] commented 3 weeks ago

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.