Reputation: 41
I just get this error when i try to create new flutter project in my PC, i already set write and copy = true to my security folder settings, any help?:
Flutter crash report.
Please report a bug at https://github.com/flutter/flutter/issues.
## command
flutter create flutterapp_2
## exception
**FileSystemException: FileSystemException: Cannot copy file to 'C:\Users\Administrator\Desktop\flutterapp_2\android\app\src\main\res\mipmap-hdpi\ic_launcher.png'**, path = 'C:\Users\Administrator\Desktop\flutter\packages\flutter_tools\templates\app\android.tmpl\app\src\main\res\mipmap-hdpi\ic_launcher.png' (OS Error: Acceso denegado.
, errno = 5)
```
#0 _File.throwIfError (dart:io/file_impl.dart:635:7)
#1 _File.copySync (dart:io/file_impl.dart:340:5)
#2 ForwardingFile.copySync (package:file/src/forwarding/forwarding_file.dart:30:50)
#3 ForwardingFile.copySync (package:file/src/forwarding/forwarding_file.dart:30:50)
#4 Template.render.<anonymous closure> (package:flutter_tools/src/template.dart:256:18)
#5 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
#6 Template.render (package:flutter_tools/src/template.dart:182:24)
#7 CreateCommand._renderTemplate (package:flutter_tools/src/commands/create.dart:781:21)
#8 _rootRunUnary (dart:async/zone.dart:1198:47)
#9 ...
```
flutter doctor:
[✓] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Versión 10.0.18363.657], locale es-419) • Flutter version 1.20.2 at C:\Users\Administrator\Desktop\flutter • Framework revision bbfbf1770c (4 days ago), 2020-08-13 08:33:09 -0700 • Engine revision 9d5b21729f • Dart version 2.9.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at C:\Users\Administrator\AppData\Local\Android\sdk • Platform android-30, build-tools 30.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted.
[!] Android Studio (version 4.0) • Android Studio at C:\Program Files\Android\Android Studio ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[✓] VS Code (version 1.48.0) • VS Code at C:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.13.2
Upvotes: 0
Views: 2615
Reputation: 51
In my case it was the antivirus.
When I ran the command on the power shell, the same error appeared, but when I ran the CMD, the antivirus alerted.
I released access to the folder and it worked after that.
Then, check if any protection is blocking the accesses.
Upvotes: 5
Reputation: 41
Please close this one, i just create the app in /C: directory and then works correctly
Upvotes: 2
Reputation: 1080
It simply looks like that your current user has no permissions to create files within the folder where you want to create the project.
Since in the error it looks like that you are using a Windows device: Try either to simply choose a different location for your project. Like your user folder of the current logged in user or start your console with admin rights.
Upvotes: 2