admin管理员组

文章数量:1124536

When I run my flutter app I get an error:

Target debug_android_application failed: PathExistsException: Cannot copy file to 'path of png', path = 'C:\Users\User\Desktop\flutter_projects\quiz_app\assets\images\quizlogo.png' (OS Error: Cannot create a file when that file already exists., errno = 183)

When I write flutter clean and then flutter pub get in the terminal and restart VS Code I can run my app for one time but after this one time the error appears again.

code of pubspec.yaml where I declare assets if it helps:

assets:
  - assets/images/

How can I fix this?

When I run my flutter app I get an error:

Target debug_android_application failed: PathExistsException: Cannot copy file to 'path of png', path = 'C:\Users\User\Desktop\flutter_projects\quiz_app\assets\images\quizlogo.png' (OS Error: Cannot create a file when that file already exists., errno = 183)

When I write flutter clean and then flutter pub get in the terminal and restart VS Code I can run my app for one time but after this one time the error appears again.

code of pubspec.yaml where I declare assets if it helps:

assets:
  - assets/images/

How can I fix this?

Share Improve this question edited 2 days ago Frank van Puffelen 598k84 gold badges887 silver badges858 bronze badges asked 2 days ago JackJack 234 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Ensure the indentation is correct in your pubspec.yaml. YAML is very sensitive to indentation.

flutter:
  assets:
    - assets/images/

本文标签: dartHow to solve PathExistsException error in flutterStack Overflow