flutterdebugging

Flutter FAILURE: Build failed with an exception Could not move to temporary workspace


flutter build apk --release


FAILURE: Build failed with an exception.

* Where:
Settings file 'C:\Users\caitl\Documents\Diko\System-Development\waste_pal - Copy\android\settings.gradle.kts' line: 19

* What went wrong:
Error resolving plugin [id: 'dev.flutter.flutter-plugin-loader', version: '1.0.0']
> A problem occurred configuring project ':gradle'.
   > Multiple build operations failed.
         Could not move temporary workspace (C:\Users\caitl\.gradle\caches\transforms-4\a2e215d71d166f3398ea1970267bf081-6b7d0aa1-f301-4c0c-b3d7-9ca6ac5bd3bf) to immutable location (C:\Users\caitl\.gradle\caches\transforms-4\a2e215d71d166f3398ea1970267bf081)
         Could not move temporary workspace (C:\Users\caitl\.gradle\caches\transforms-4\4456fbe8501097626366f0396fd66daa-d5f89638-1b96-4421-9070-b1e0e58a68d5) to immutable location (C:\Users\caitl\.gradle\caches\transforms-4\4456fbe8501097626366f0396fd66daa)
      > Could not move temporary workspace (C:\Users\caitl\.gradle\caches\transforms-4\a2e215d71d166f3398ea1970267bf081-6b7d0aa1-f301-4c0c-b3d7-9ca6ac5bd3bf) to immutable location (C:\Users\caitl\.gradle\caches\transforms-4\a2e215d71d166f3398ea1970267bf081)
      > Could not move temporary workspace (C:\Users\caitl\.gradle\caches\transforms-4\4456fbe8501097626366f0396fd66daa-d5f89638-1b96-4421-9070-b1e0e58a68d5) to immutable location (C:\Users\caitl\.gradle\caches\transforms-4\4456fbe8501097626366f0396fd66daa)

* 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.
> Get more help at https://help.gradle.org.

BUILD FAILED in 44s
Running Gradle task 'assembleRelease'...                           45.8s
Gradle task assembleRelease failed with exit code 1

I already did the flutter pub clean, flutter pub get I was able to build my apps before, but I wasn't able to do it during my updated app. I also tried deleting the transform-4 folder as well as restarting my pc and deleting the cache folder, as well as the .gradle folder, but it still doesn't build.


Solution

  • 1. Force Delete the transforms-4 and .gradle cache again

    Sometimes it needs admin perms to actually delete stuff. Go to: C:\Users\caitl.gradle\caches\

    Delete transforms-4

    Also: delete .gradle folder in your project directory

    Empty the recycle bin just in case

    2. Try with --no-daemon

    flutter build apk --release --no-daemon

    3. Final Boss: Move Project Folder

    Move your whole Flutter project to a different location like: C:\FlutterProjects\waste_pal\

    Avoid spaces and “Copy” or “- Copy” in path names. Windows sometimes freaks out over that during Gradle ops.