In android studio,cannot load 2 facets-unknown fac

2020-01-27 12:29发布

When I open android studio I am getting an error- "Error loading project: Cannot load 2 facets. When I clicked to see the error the following appeared

"2 facets cannot be loaded. You can mark them them as ignored to suppress this error notification. Unknown facet type:'android', Unknown facet type:'android-gradle'

I tried to add facets ( In Project Structure > Project settings > Modules > clicked project name, then clicked Android as well as Android-Gradle) But both showed as "cannot load facet, unknown facet type." Under Project settings > Facets > both Android and Android-Gradle are displayed as 'Invalid facets'. My project was running smoothly. This problem occured when I force-closed my laptop before exiting android studio as everything got stuck. After that whenever I open the android studio this problem occurs. I am not able to run my project. Can anyone please help me to solve this?

12条回答
我欲成王,谁敢阻挡
2楼-- · 2020-01-27 13:07

In Android Studio go to

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

enter image description here

查看更多
家丑人穷心不美
3楼-- · 2020-01-27 13:08

I faced this issue in Android Studio 3.2.1 I had to re-import my project after that it works.

查看更多
女痞
4楼-- · 2020-01-27 13:09
  1. Go To ->File->Settings->Plugins->disable/enable Android Support Plugins->Press Ok Just re-enable Android Support plugin. Then it will ask to restart. Restart them thats it
查看更多
混吃等死
5楼-- · 2020-01-27 13:13

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

查看更多
兄弟一词,经得起流年.
6楼-- · 2020-01-27 13:18

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
查看更多
做个烂人
7楼-- · 2020-01-27 13:19

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

查看更多
登录 后发表回答