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
162.21k stars 26.64k forks source link

[tool_crash] FileSystemException: Creation failed, OS Error: The system cannot find the path specified., errno = 3 #145657

Closed JaiPreet23 closed 1 month ago

JaiPreet23 commented 1 month ago

Command

flutter --no-color build apk

Steps to Reproduce

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

Logs

FileSystemException: Creation failed, OS Error: The system cannot find the path specified. , errno = 3

#0      _Directory.createSync (dart:io/directory_impl.dart:129:7)
#1      _Directory.createSync (dart:io/directory_impl.dart:124:16)
#2      _Directory.createSync (dart:io/directory_impl.dart:124:16)
#3      _Directory.createSync (dart:io/directory_impl.dart:124:16)
#4      _Directory.createSync (dart:io/directory_impl.dart:124:16)
#5      _Directory.createSync (dart:io/directory_impl.dart:124:16)
#6      _Directory.createSync (dart:io/directory_impl.dart:124:16)
#7      ForwardingDirectory.createSync (package:file/src/forwarding/forwarding_directory.dart:20:16)
#8      ErrorHandlingDirectory.createSync.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:428:22)
#9      _runSync (package:flutter_tools/src/base/error_handling_io.dart:590:14)
#10     ErrorHandlingDirectory.createSync (package:flutter_tools/src/base/error_handling_io.dart:427:12)
#11     SettingsFile.writeContents (package:flutter_tools/src/base/utils.dart:162:17)
#12     updateLocalProperties (package:flutter_tools/src/android/gradle_utils.dart:722:14)
#13     AndroidGradleBuilder.buildGradleApp (package:flutter_tools/src/android/gradle.dart:332:5)
#14     AndroidGradleBuilder.buildGradleApp (package:flutter_tools/src/android/gradle.dart:512:19)
<asynchronous suspension>
#15     AndroidGradleBuilder.buildApk (package:flutter_tools/src/android/gradle.dart:220:5)
<asynchronous suspension>
#16     BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:116:5)
<asynchronous suspension>
#17     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1350:27)
<asynchronous suspension>
#18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#19     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
[✓] Flutter (Channel stable, 3.16.4, on Microsoft Windows [Version 10.0.22621.1105], locale en-US)
    • Flutter version 3.16.4 on channel stable at D:\flutter_sdk\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2e9cb0aa71 (3 months ago), 2023-12-11 14:35:13 -0700
    • Engine revision 54a7145303
    • Dart version 3.2.3
    • DevTools version 2.28.4

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

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\Windows11\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 not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[✓] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\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)

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

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

! Doctor found issues in 2 categories.

Flutter Application Metadata

No pubspec in working directory.

huycozy commented 1 month ago

Hi @JaiPreet23 I don't see there is any similar issue with the same error number and message from our issue database. The error could be changed on the latest Flutter version. Could you try upgrading the latest Flutter stable version 3.19.4 or master channel and share the new output trace log here?

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 2 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.