Flutter build error at task :app:copyFlutterAssetsDebug

700

Solution 1

First: I'm new at StackOverflow and English is not my first language, so please have patience.

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' (or whatever it's called in english) 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

Any suggestions or corrections are very welcome

Solution 2

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

Share:
700
Fawwaz Yusran
Author by

Fawwaz Yusran

Updated on December 13, 2022

Comments

  • Fawwaz Yusran
    Fawwaz Yusran over 1 year

    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?