Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter build error at task :app:copyFlutterAssetsDebug

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?

like image 828
Fawwaz Yusran Avatar asked Jun 25 '26 08:06

Fawwaz Yusran


1 Answers

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
like image 90
FMorschel Avatar answered Jun 26 '26 21:06

FMorschel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!