Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In android studio,cannot load 2 facets-unknown facet type:android and android-gradle

Just enable Android Support plugin.

  1. Click Ctrl+Alt+S in Windows or Meta+Comma in Mac.
  2. In top search bar type "plugin".
  3. On right side it will show a list of plugins, find Android Support plugin, check it and click OK at the bottom of screen.

This is how it looks:

How to solve "cannot load 2 facets-unknown facet type:android and android gradle" problem


In Android Studio go to

File -> Settings - > Plugins -> Enable "Android Support" Plugin.

enter image description here


File, Then Settings->Plugin->Enable/Renable Plugin --> Apply --> Restart


This problem occured when i'd updated Android Studio.

In case nothing from other answers works, you don't have another option, except removing broken settings and making clean setup.

So what i am suggesting:

  • Use Settings Repository Feature to store personal IDE settings
  • close studio
  • remove .AndroidStudioX folder from user folder
  • re-launch studio, do not copy settings from previous version (because settings probably broken and auto-import couldn't import it well)
  • import personal settings from Settings Repository

For me I went to Settings -> Plugins and de-selected Gradle then immediately re-selected it. Android Studio then asked if I wanted to enable Groovy so I said yes and let it restart and now everything is happy again! (it was checked, but clearly somewhere deep down not truly enabled, so toggling the check-box sorted it)

Not sure if my cause was installing Flutter, but I did have to disable the Flutter plugin before I could build again.


I had the same problem with an ever-increasing number of facets - first 2, then 4, then 5 - and none of the above solutions worked. My solution (Android Studio 3.3, OS X) was to delete ~/Library/Preferences/AndroidStudio3.3/disabled_plugins.txt, which contained org.jetbrains.android and org.jetbrains.maven

I imagine if you have deliberately disabled plugins then you'll have to disable them again manually, but I was able to load all facets again.