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

查看:62
本文介绍了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:

文件 ->其他设置 ->默认设置,找到文件编码,将项目编码改为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天全站免登陆