Android Studio文件映射问题,无法识别文件 [英] Android Studio file mapping problem, not recognize files

查看:166
本文介绍了Android Studio文件映射问题,无法识别文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请在下面查看打开的文件的快照.

Please look at snapshot of the opened file below.

当我双击MyUtils.java时,将显示此XML格式:

When I double click on MyUtils.java it is showing this XML format:

但是当我从Windows资源管理器中手动打开它时,它里面已经有正确的Java代码:

But when I open it manually from Windows Explorer it already have correct Java code inside:

我尝试了这些,但问题仍然存在:

I have tried these but the problem remains:

  • 清理,重建项目
  • 使缓存无效并重新启动
  • 从项目中删除了.gradle.idea自动生成的文件夹
  • 更新并重新启动Studio.
  • clean, rebuild project
  • invalidate cache and restart
  • deleted .gradle and .idea auto generated folders from the project
  • updated and restart Studio.

推荐答案

由于错误的文件编码而发生,您可以看到我对此的回答

It happens because of wrong File Encoding and you can see my answer about it in here.

解决方案::该解决方案将重新安装Android Studio,或者转到:

Solution: The solution will be reinstalling Android Studio or, go to:

File -> Other Settings -> Default Settings,找到文件编码,将Project Encoding更改为System-DefaultUTF-8格式.

File -> Other Settings -> Default Settings, find File Encodings, change Project Encoding to System-Default or UTF-8 format.

这篇关于Android Studio文件映射问题,无法识别文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆