是Android Studio损坏我的项目文件吗? [英] is Android Studio corrupting my project files?

查看:82
本文介绍了是Android Studio损坏我的项目文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理的项目中出现两个非常烦人的错误.Android Studio会使用同一项目中的其他类来覆盖许多类中的代码.

1-文件内容错误
2-有些文件中的编码似乎有奇怪的字符

为了让您有个主意,我将在下面上传一些屏幕截图:

这应该是枚举类.

该课程已在另一个课程中重复(覆盖)

这堂课全都搞砸了,有奇怪的字符...

起初,我以为文件确实已损坏,然后我在各自的文件夹中打开它们以检查它是否仅在Android Studio中,并且在那里完全正常.

ActivitiesMode.java

ReviewDatesRecyclerView(重复的文件)

ReviewEditRecyclerViewAdapter(UTF奇怪字符)

有人对可能发生的事情有想法吗?

解决方案

我设法通过完全重新安装Android Studio 3.3并删除所有配置和相关文件夹来解决所有这些问题.

首先,我重新安装了IDE,但是发生了同样的问题.然后,我尝试遵循有关此答案的编码说明"

I have two very annoying bugs which is ocurring in the project I am working with. Android Studio keeps overwritting code from many classes using another classes inside the same project.

1 - File contents are wrong
2 - The encoding inside some files seems to have strange characters

For you to have an idea, I will upload a few screenshots below:

This one was supposed to be an enumeration class.

This class was duplicated in another class (overwritting)

This class is all messed up and has strange characters...

At first, I thought the files were really corrupted, then I opened them in their respective folders to check whether it was only in Android Studio or not, and they are completely normal there.

ActivitiesMode.java

ReviewDatesRecyclerView (duplicated file)

ReviewEditRecyclerViewAdapter (UTF Strange characters)

Does someone has an idea on what can be happening?

解决方案

I managed to solve all these problems by completely reinstalling Android Studio 3.3 and deleting all the configurations and related folders.

At first, I've reinstalled the IDE, but the same problem occured. Then I tried to follow instructions about encoding on this answer "Android Studio : unmappable character for encoding UTF-8"

None of these had any effect.

Here's how I fixed it:

  • Uninstalled Android Studio
  • Deleted Android Studio SDK
  • Deleted .gradle, .android, .AndroidStudio3.3 folders located in C:\Users\MyUserName
  • Fresh Installed Android Studio 3.3
  • Opened it's encoding settings on File > Settings > File Encodings
  • Changed all encoding types to UTF-8 (Global, Project and Default)

这篇关于是Android Studio损坏我的项目文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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