Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Files are edited without my intervention

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.

like image 589
whitehat Avatar asked Mar 20 '19 03:03

whitehat


People also ask

Where are dependencies stored Android Studio?

The Gradle build system in Android Studio makes it easy to include external binaries or other library modules to your build as dependencies. The dependencies can be located on your machine or in a remote repository, and any transitive dependencies they declare are automatically included as well.

Can I delete idea folder Android Studio?

gradle/ and . idea/ are safe to delete, though I would have the IDE not be open on that project while you do it. If that is your only project, close Android Studio, then delete those directories using your OS file explorer or the command line.

How pass data from activity to services in Android?

Explanation. Using putExtra() method, we can send the data. While using it, we need to call setResult() method in services. We can also store data in a common database and access it on services as well as in Activity.

How do I access internal shared storage on Android?

You can also access free internal storage from your Android phone through Settings > System > Storage > Device storage. Here you can preview what data are using your internal storage and how much free storage you can use furtherly.


2 Answers

I have tried below solution and its work for me.

I have delete the caches folder from C: Drive. after an open project in an Android studio.

C:\Users\admin.AndroidStudio3.3\system\caches

like image 199
VIISHRUT MAVANII Avatar answered Sep 29 '22 02:09

VIISHRUT MAVANII


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.

like image 43
whitehat Avatar answered Sep 29 '22 00:09

whitehat