Android Studio文件映射问题,无法识别文件 [英] Android Studio file mapping problem, not recognize files
问题描述
请在下面查看打开的文件的快照.
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-Default
或UTF-8
格式.
File -> Other Settings -> Default Settings
, find File Encodings, change Project Encoding
to System-Default
or UTF-8
format.
这篇关于Android Studio文件映射问题,无法识别文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!