Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: A project with the name android already exists. Duplicate root element android

I currently have a Flutter app that gives an error in VSCode; the project itself builds for Android without issue. The issue appears to plague solely the VSCode editor and is down to there being a sub-project within the main project for Android. This is because I've nested (copy & pasted) a custom flutter package into the local file structure, and the local flutter package includes an example project.

Ideally I'd like to not delete the "example" directory from the nested local package, I'd like VSCode to just relax. Is there a way to deactivate these warnings?

File structure root->android(issue) and root->packages->package name->example->android

A project with the name android already exists.
The supplied phased action failed with an exception.
Duplicate root element android

Update: By recreating the package using the plugin commands, as suggested below, the root issue still remains though the error text has changed slightly to be as shown below:

The supplied phased action failed with an exception.
A problem occurred evaluating settings 'android'.
A problem occurred evaluating script.
assert pluginDirectory.exists()
       |               |
       |               false

New Error text: The supplied phased action failed with an exception. A problem occurred evaluating settings 'android'. A problem occurred evaluating script. assert pluginDirectory.exists()

like image 345
Joeseph Schmoe Avatar asked May 09 '26 20:05

Joeseph Schmoe


1 Answers

Try disabling the VS Code extension "Language Support for Java(TM) by Red Hat" if you have installed it. I had the same issue and disabling that extension solved it.

like image 117
kine Avatar answered May 11 '26 11:05

kine



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!