5

I'm trying to build a Flutter app in debug mode on a physical device, but the build fails with the following error: FAILURE: Build failed with an exception.

  • What went wrong: Multiple build operations failed. Could not read workspace metadata from C:\Users\USER.gradle\caches\8.10.2\transforms\7c689a5a75dba8db063ea504d8a8c22b\metadata.bin Could not read workspace metadata from C:\Users\USER.gradle\caches\8.10.2\transforms\25e07fe667eb3150ae55636163d489c1\metadata.bin ... (and many more similar errors). The error seems to be related to corrupted Gradle cache files. I've tried the following steps but the issue persists:

Ran flutter clean.

Deleted the global Gradle cache folder (C:\Users\USER.gradle\caches).

Ran flutter pub get to refresh dependencies.

Rebuilt the app using flutter run.

Despite these steps, the build still fails with the same errors.

4
  • Can you provide your build code configurations and flutter doctor results? Commented Mar 22, 2025 at 9:30
  • Please provide enough code so others can better understand or reproduce the problem. Commented Mar 22, 2025 at 9:31
  • 1
    same for me >> FAILURE: Build failed with an exception. * What went wrong: Could not read workspace metadata from /Users/kawsar.ahamad/.gradle/caches/8.7/groovy-dsl/4328d1ab2ab4c8bb668d7a3c289f270f/metadata.bin > /Users/kawsar.ahamad/.gradle/caches/8.7/groovy-dsl/4328d1ab2ab4c8bb668d7a3c289f270f/metadata.bin (No such file or directory) * 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 help.gradle.org. Commented Jul 1, 2025 at 10:09
  • deleted the global Gradle cache folder (C:\Users\USER.gradle\caches). i cant delete cache files Commented Nov 2, 2025 at 4:11

2 Answers 2

7

You need to delete C:/Users/<YourUserName>/.gradle completely, because the cache is probably corrupted and needs to be recreated.

Sign up to request clarification or add additional context in comments.

Comments

0

Try to delete/backup and remove the C:\Users\USER.gradle directory as well

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.