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.17k stars 26.65k forks source link

how to fix #146694

Closed KentMT28 closed 4 weeks ago

KentMT28 commented 1 month ago

Command

flutter create --template app --overwrite .

Steps to Reproduce

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

Logs

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

#0      _Directory.createSync (dart:io/directory_impl.dart:124:7)
#1      _File.createSync (dart:io/file_impl.dart:303:14)
#2      ForwardingFile.createSync (package:file/src/forwarding/forwarding_file.dart:26:16)
#3      ErrorHandlingFile.createSync.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:282:22)
#4      _runSync (package:flutter_tools/src/base/error_handling_io.dart:587:14)
#5      ErrorHandlingFile.createSync (package:flutter_tools/src/base/error_handling_io.dart:281:5)
#6      Template.render.<anonymous closure> (package:flutter_tools/src/template.dart:321:28)
#7      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:633:13)
#8      Template.render (package:flutter_tools/src/template.dart:281:24)
#9      CreateBase.renderMerged (package:flutter_tools/src/commands/create_base.dart:483:21)
<asynchronous suspension>
#10     CreateBase.generateApp (package:flutter_tools/src/commands/create_base.dart:506:23)
<asynchronous suspension>
#11     CreateCommand.runCommand (package:flutter_tools/src/commands/create.dart:361:31)
<asynchronous suspension>
#12     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1389:27)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#14     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#15     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:355:9)
<asynchronous suspension>
#16     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
[✓] Flutter (Channel stable, 3.19.5, on Microsoft Windows [Version 10.0.22631.3447], locale en-US)
    • Flutter version 3.19.5 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (2 weeks ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.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\featu\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • 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 Build Tools 2022 17.5.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
    • Visual Studio Build Tools 2022 version 17.5.33516.290
    • Windows 10 SDK version 10.0.22000.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)

[✓] VS Code (version 1.88.1)
    • VS Code at C:\Users\featu\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.86.0

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

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

• No issues found!

Flutter Application Metadata

No pubspec in working directory.

Gieted commented 1 month ago

Make sure the parent folder of this file exists

darshankawar commented 4 weeks ago

Closing this as a duplicate of https://github.com/flutter/flutter/issues/98066.

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.