I'm attempting to run a Flutter application, but keep getting this output in the console:
Launching lib/main.dart on Android SDK built for x86 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:desugarDebugFileDependencies'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> /home/(username)/Android/Sdk/build-tools/28.0.3/core-lambda-stubs.jar
* 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 41s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Deleting the /build-tools/28.0.3 folder and rerunning the app worked for me!
I found that my build-tools/28.0.3/ directory was missing many files, probably from a failed install. I used the SDK manager in android studio to remove 28.0.3 and then reinstalled it and the files are there now.
I'm using linux mint,in my case I went to: /home/(username)/Android/Sdk/build-tools/ and delete the folder "28.0.3". Then run the application and android studio reinstall this folder, and the application works correctly without the error mentioned.