Open arunkumard001 opened 4 years ago
Hi @arunkumard001
Can you please provide your flutter run --verbose
?
Thank you
Hi @arunkumard001 Can you please provide your
flutter run --verbose
? Thank you
@arunkumard001 I think you must change the flutter location folder from C:\src\flutter to %userprofile%\Documents\flutter or any other location don't require write permission and try again.
Don't forget to set the new Flutter folder path in your system environment variables.
crash report from stable/2.5.1:
Thread 0 main threadFileSystemException: FileSystemException: Creation failed, path = 'C:\Users\<username>\Documents\flutter_demo\lib' (OS Error: The system cannot find the file specified.
, errno = 2)
at _Directory.createSync(directory_impl.dart:133)
at _File.createSync(file_impl.dart:270)
at ForwardingFile.createSync(forwarding_file.dart:23)
at ErrorHandlingFile.createSync.<anonymous closure>(error_handling_io.dart:286)
at _runSync(error_handling_io.dart:597)
at ErrorHandlingFile.createSync(error_handling_io.dart:285)
at Template.render.<anonymous closure>(template.dart:293)
at _LinkedHashMapMixin.forEach(compact_hash.dart:400)
at Template.render(template.dart:253)
at CreateBase.renderMerged(create_base.dart:429)
at <asynchronous gap>(async)
at CreateBase.generateApp(create_base.dart:440)
at <asynchronous gap>(async)
at CreateCommand.runCommand(create.dart:269)
at <asynchronous gap>(async)
at FlutterCommand.run.<anonymous closure>(flutter_command.dart:1125)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at CommandRunner.runCommand(command_runner.dart:209)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand.<anonymous closure>(flutter_command_runner.dart:288)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand(flutter_command_runner.dart:236)
at <asynchronous gap>(async)
at run.<anonymous closure>.<anonymous closure>(runner.dart:62)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at main(executable.dart:92)
at <asynchronous gap>(async)
Any solution ?
@exaby73 since many issue are consolidated under this one, maybe could be worth the label crowd
@christopherfujino From a similar issue, @AniketMalik found the culprit to be Windows Defender blocking access to the Documents directory. Could this be related to this issue?
@christopherfujino From a similar issue, @AniketMalik found the culprit to be Windows Defender blocking access to the Documents directory. Could this be related to this issue?
Ahh yes, that sounds very likely. I wish defender would leave us some breadcrumbs to know what happened...
Maybe the error message could be improved to add suggestions that the project should not be in the Documents directory? Not sure if that's a plausible one.
Many issues with this error are Flutter trying to find files in the Documents directory e.g. https://github.com/flutter/flutter/issues/95753. From what I've gathered in past issues errno = 2
is usually caused because of the Documents directory, and errno = 3
is caused when trying to access a file in another drive e.g. https://github.com/flutter/flutter/issues/98514.
This issue is not related to Flutter. Switch off "Controlled Folder Access" under Settings > Windows Security > Virus & threat protection > Virus & Threat Protection Settings -> Manage Settings > Controlled folder access -> Manage controlled folder access.
Command
Steps to Reproduce
Logs
FileSystemException: Cannot create file, OS Error: The system cannot find the file specified. , errno = 2
Flutter Application Metadata
No pubspec in working directory.