问题描述
当我打开 android studio 时出现错误-错误加载项目:无法加载 2 个方面.当我点击查看错误时,出现以下错误
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 个方面.您可以将它们标记为已忽略以抑制此错误通知.未知方面类型:'android',未知方面类型:'android-gradle'
我尝试添加方面(在项目结构 > 项目设置 > Modules > 点击项目名称,然后点击 Android 以及 Android-Gradle>) 但两者都显示为无法加载方面,未知方面类型".在 Project settings > Facets > 下,Android 和 Android-Gradle 都显示为Invalid facets".我的项目运行顺利.当我在退出 android studio 之前强制关闭我的笔记本电脑时出现了这个问题,因为一切都被卡住了.之后每当我打开android studio时就会出现这个问题.我无法运行我的项目.谁能帮我解决这个问题?
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?
推荐答案
只需启用 Android Support
插件.
- 在 Windows 中单击
Ctrl+Alt+S
或在 Mac 中单击Meta+Comma
. - 在顶部搜索栏中输入插件".
- 右侧会显示插件列表,找到
Android Support
插件,勾选后点击屏幕下方的OK
.
- Click
Ctrl+Alt+S
in Windows orMeta+Comma
in Mac. - In top search bar type "plugin".
- On right side it will show a list of plugins, find
Android Support
plugin, check it and clickOK
at the bottom of screen.
这是它的样子:
这篇关于在 android studio 中,无法加载 2 个 facets-unknown facet type:android 和 android-gradle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!