Flutter build error at task :app:copyFlutterAssetsDebug
Asked Answered
M

2

7

When building a Flutter app in my linux machine, I encountered this error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:copyFlutterAssetsDebug'.
> Could not copy file '/FwzFiles/GitHub/nilai_sekolah/build/app/intermediates/flutter/debug/android-arm64/flutter_assets' to '/FwzFiles/GitHub/nilai_sekolah/build/app/intermediates/merged_assets/debug/mergeDebugAssets/out/flutter_assets'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

I've had to setup my Android device (Google Pixel 2) using this tutorial (which requires me to change udev permissions), so is this related to the error at all? I'm able to pull and push files to my device.

How do I fix this error?

Medieval answered 13/8, 2019 at 7:56 Comment(0)
F
4

I've had the same error some time ago, and at the end of a lot of research, I realized that the directory that I created for my project was a partition mounted when my Ubuntu was booting, and that was giving this directory root owner, and then, I couldn't edit anything there with flutter. I edited /etc/fstab and it solved my problem.

For your problem I would use: sudo chown -R $USER: /FwzFiles/GitHub/[project_folder]

Then open the properties of your project folder and go to 'permissions' and see if you are the owner of that folder.

And if that alone does not work: sudo chmod -R 777 /FwzFiles/GitHub/[project_folder]

Explanation:

  • sudo chown -R recursively change owner
  • $USER the current user
  • : also change group to the specific user
  • sudo chmod -R recursively change permissions of files & folders
  • 777 value for read/write/execute
Fraught answered 18/3, 2020 at 19:2 Comment(0)
H
2

Simple. Just delete the executionHistory.bin file from ./gradle/6.7/executionHistory/

Haggle answered 2/2, 2022 at 9:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.