0

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':gradle:jar'.

Entry FlutterPlugin.class is a duplicate but no duplicate handling strategy has been set.

It is an error from trying to build an app using flutter/dart in VS Code.

I tried searching for the build.gradle file in flutter project so that I could add the provided solution below:

duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
```}

but no avail

1 Answer 1

1

try some tips below and tell me if that works

Restart your computer and relaunch the project

This might seem basic, but a simple restart of your computer and a relaunch of your Flutter project can sometimes resolve temporary issues related to the development environment.Try also to upgrade flutter with : flutter upgrade.

Delete the android folder and rebuild the project (if the project isn't too advanced)

If the first step doesn't work and your project isn't overly complex (meaning you haven't made deep Android-specific modifications), you can try deleting the android folder at the root of your Flutter project.

After deleting it, open your terminal in your project's directory and run the following command:

flutter create .

It will recreate the android folder

Provide more details about the error

If none of the above solutions work, we'll need more information to diagnose the problem. Could you please:

Copy and paste the full error message you're getting in your terminal or IDE.

Indicate the Flutter version you're using (flutter --version).

Specify any recent changes you might have made to your project or environment.

This additional information will help us pinpoint the exact cause of the build failure.

Thanks !

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

2 Comments

Thanks a lot @Nistroy. I restarted my computer and then performed a flutter upgrade. It kind of solve the problem but created other errors. The problem mainly was coming from the current version of firebase dependencies and the current flutter version I am using. So, I decided to delete the project and recreate it. So far, I have been able to resolve the errors encountered during execution of the new project. Thanks once again!
I'm happy for you! You don't have any other problems anymore?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.