为什么应用程序build.gradle显示为纯文本(无大象图标)?

时间:2019-09-15 08:56:54

标签: android-studio android-gradle-plugin

我注意到我的build.gradle(应用程序)文件之一现在显示为纯文本。我想将其恢复为正常状态(例如gradle项目),以便可以正确升级/更新任何库。

enter image description here enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

这对我有用,假设使用Android Studio 3.5:-

关闭Android Studio。
开始/运行:“%USERPROFILE%\。AndroidStudio3.5 \ config \ options”
%USERPROFILE%是您的用户个人资料文件夹,对我来说,它是“ C:\ Users \ Jonathan \”。
在该文件夹中有一个“ filetypes.xml”文件,请在文本编辑器(如记事本)中打开它。
找到有问题的文件的映射模式。就我而言,它是这样的:-

<application>
  <component name="FileTypeManager" version="17">
    <extensionMap>
      <mapping pattern="toggle_off_color.xml" type="PLAIN_TEXT" />
    </extensionMap>
  </component>
</application>

删除未正确显示的文件的映射模式行。
保存更改的filetypes.xml
运行Android Studio!


我通过文件搜索找到了我的所有修改过的文件的硬盘驱动器,因为它出错了(大约一个月前),并且包含文件名不正确的文本。与特工Ransack:https://www.mythicsoft.com/agentransack/