Android Studio 3.2.1不断破坏奇怪XML上的Java文件 [英] Android Studio 3.2.1 keeps corrupting Java files on weird XML

查看:120
本文介绍了Android Studio 3.2.1不断破坏奇怪XML上的Java文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android Studio上出现随机崩溃后,Android Studio正在打开我的许多代码,就像是XML或R.class.

After a random crash on Android Studio, a lot of my code is being opened by Android Studio as if it was an XML or R.class.

损坏的文件1的示例

损坏的文件2的示例

更好地说明它:全新安装了Android Studio(任何版本)后,它确实会纠正自身,并且在3.1.4中没有发生,但是我使用的是3.2中的功能.经过不到6小时的编码,Android上发生了一次随机崩溃,我通过AS报告了此错误,这突然发生在我的许多文件上,直到完全重新安装Android之前,我不允许再次构建它.

Explaning it better: It does correct itself after a fresh install of Android Studio (any version), and it hasn't happened in 3.1.4, but I'm using features from 3.2. After less than 6h coding, a random crash happens on Android, I report it by the AS and this suddenly happens to many of my files, not allowing me to build it again until I reinstall Android entirely.

我以管理员身份运行AS,并且到处都有权限. 我的项目也没有损坏,我的文件也没有损坏,因为每一次全新安装都只会带回我的代码,并且我可以进行编码,直到发生任何/随机崩溃,从而造成AS/Gradle损坏.

I'm running AS as an Administrator, and I do have permission everywhere. My project is not corrupted nor are my files, since every single fresh install simply brings my code back and I can code until any/a random crash happens, creating this AS/Gradle corruption.

您可以说,即使在AS上损坏",我的代码实际上也很好通过任何外部编辑器打开,因此还原我的Git代码不足以使我摆脱这个问题(我希望).

As you can tell, even when "corrupted" on AS, my code is actually fine when opened with any external editor, so reverting back my Git code is not enough to make me get rid of this problem (I wish).

一些我已经尝试过的重要事情:

Some important things I already tried:

  • 清除缓存并重新启动Android Studio
  • 使用Android 3.2.1和3.3 RC
  • 重建项目
  • 与Gradle,文件系统等重新同步...
  • /user/.gradle/caches /user/.AndroidStudio3.3/system/caches
  • 清除缓存
  • 从项目的文件夹中删除.idea和.gradle
  • 重新安装Android Studio(还尝试了这两个版本)
  • Clear Cache and Restart Android Studio
  • Use Android 3.2.1 and 3.3 RC
  • Rebuild Project
  • Resync with Gradle, FileSystem, etc, etc...
  • Clear caches from /user/.gradle/caches and from /user/.AndroidStudio3.3/system/caches
  • Delete .idea and .gradle from the project's folder
  • Reinstall Android Studio (also tried with both versions)

我在这里发现了一个相关问题,但是那家伙只是删除了这两个文件.但这是我无法做到的,因为这是我的项目文件所发生的.可以在此处找到此相关问题.

I found a related issue here, but the guy simply deleted both of those files. But that's something I can't do, since this is happening with my project files. This related issue can be found here.

我还发现了另外3或4个帖子,这些帖子从不回答有效答案,并且被从未解决"或通过安装新版本的AS解决.但是我已经在尝试Beta了,这个错误/问题仍然存在....

I also found another 3 or 4 posts, which where never answered with a valid answer and that were "never solved" or were solved by installing a new version of AS. But I'm already trying the Beta and this error/problem persists....

考虑此帖子以寻求帮助.这在我的开发中一直困扰着我,使得我无法在超过6个小时的时间里进行编程,然后在每个及任何较新版本的AS中都出现这种奇怪的行为.

Consider this post a cry for help. This is haunting me in my development in such a way that I simply can't program more than 6 hours before getting this bizarre behavior in each and any newer version of AS.

参考:

与@相关Vengat

与@CanProgram相关(从2.3.3开始?)

Related by @CanProgram (since 2.3.3?)

与@RmGetty Bautista相关

与KeepCoding相关

推荐答案

Tbh,android studio很烂.如果您遇到此问题,请r.i.p修改您的代码. 我试图最大程度地减少文件损坏的可能性的方法是,每当我完成该程序的运行时就关闭模拟器,并且在该程序正常运行时,我将所有文件都复制到记事本中,以防万一发生不良情况. *是的,当我想在讲师面前展示我的作业时,它发生了,这要归功于记事本

Tbh, android studio sucks at that part. If you encounter that problem, then r.i.p to your code. The way I tried to minimized the chance of getting my file corrupted is by closing the emulator whenever I finished running the program, and also when it works properly, I copy all the files to a notepad just in case something bad happen. *and yes it happened right when I wanted to show my assignment in front of my lecturer, thanks to notepad I can retrieve it back

这篇关于Android Studio 3.2.1不断破坏奇怪XML上的Java文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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