本文介绍了Android Studio:无需我的干预即可编辑文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我一直在寻找一个错误,一个解决方案说:文件>使缓存无效并重新启动"

但是随后我发现我的build.gradle被未知数据取代了.

稍后,我再次将其替换为以前的"数据.然后再次执行相同的文件>使缓存无效并重新启动"

现在,我的activity_main.xml文件已替换为:

<component name="libraryTable">
  <library name="Gradle: com.android.support.constraint:constraint-layout-solver:1.1.3@jar">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support.constraint/constraint-layout-solver/1.1.3/bde0667d7414c16ed62d3cfe993cff7f9d732373/constraint-layout-solver-1.1.3.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>

是什么触发了这一点?我在这里丢失了XML代码.

解决方案

尽管Android Studio中的文件似乎已被修改并充满了一些垃圾,但是我仍然可以与其他编辑器一起打开它们,并且数据仍然存在./p>

Windows用户,请不要这样做:"File > Invalidate Caches and Restart"

我还没有找到一种在Android Studio中还原它的方法.但是能够从另一个编辑器复制并粘贴文件数据并使它工作.

I was watching around for a bug and one solution says to do: "File > Invalidate Caches and Restart"

But then I find my build.gradle replaced with unknown data.

Later I replaced it again with "previous" data. And again did the same "File > Invalidate Caches and Restart"

Now, my activity_main.xml file got replaced with this:

<component name="libraryTable">
  <library name="Gradle: com.android.support.constraint:constraint-layout-solver:1.1.3@jar">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support.constraint/constraint-layout-solver/1.1.3/bde0667d7414c16ed62d3cfe993cff7f9d732373/constraint-layout-solver-1.1.3.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>

What triggered this? I lost my XML code here.

解决方案

Though the files within Android Studio appeared to be modified and filled with some garbage, I was able to open them with other editors and the data is still there.

Windows users, don't do this: "File > Invalidate Caches and Restart"

I have not found a way to restore this in Android Studio. But was able to copy and paste the file data from another editor and make it work.

这篇关于Android Studio:无需我的干预即可编辑文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 10:31