FAILURE: Build completed with 2 failures.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade File 'com.android.builder.files.ZipCentralDirectory@6f58452a' was deleted, but previous version not found in cache
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade File 'com.android.builder.files.ZipCentralDirectory@48b70346' was deleted, but previous version not found in cache
BUILD FAILED in 23s Running Gradle task 'assembleDebug'... Running Gradle task 'assembleDebug'... Done 23.9s Exception: Gradle task assembleDebug failed with exit code 1
Try any one of the following steps:
Goto Files > Click Invalidate Caches/Restart
Restart your machine
On terminal write flutter clean and then flutter run
I had the same issue after setting up my flutter project to run on iOS. When I tried to run it back on Android, this error was thrown.
This worked for me (on Windows):
Close your project and close your code editor
Open Task Manager
Finish all vscode-related tasks you see (or related to the IDE you are using)
Finish all Java-related tasks, inclidung OpenJDK Platform binary (there are usually two of these; finish both)
Go to your project's root folder and delete the build folder
Open your project again and run
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With