WoW
WoW

Reputation: 161

Android Studio Project Corrupted

Android studio couldn't load project settings from project.iml and app.iml

I deleted those files and restarted Android Studio

Now I can't open any file inside the project.

in every file i see this:

<component name="libraryTable">
  <library name="com.google.firebase:firebase-crash-license-12.0.0">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/transforms-1/files-1.1/firebase-crash-license-12.0.0.aar/4af1d2fd848fb29a90a1c9eb639021c5/jars/classes.jar!/" />
      <root url="file://$USER_HOME$/.gradle/caches/transforms-1/files-1.1/firebase-crash-license-12.0.0.aar/4af1d2fd848fb29a90a1c9eb639021c5/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>   

Any ideas?

Upvotes: 1

Views: 781

Answers (3)

Shubham Singh
Shubham Singh

Reputation: 31

Faced same problem, here's a solution worked for me.

  1. Copy the corrupted project directory.
  2. Paste it at somewhere else.
  3. Import it in Android Studio. (File-> New-> Import project)
  4. And uncorrupted project get restored.

PS: You must have original corrupted project. (Means, copy it without tampering project structure)

Upvotes: 1

Anna
Anna

Reputation: 532

I had the same problem. I tried "Invalidate Caches", delete folders ".gradle", ".iml" and ".idea" and it didn't help. Finally I installed android preview and it works.

And 5 minutes ago I found another solution. I have fixed this problem by deleting the folder AndroidStudio3.4\system\caches.

Upvotes: 2

Slavi Petrov
Slavi Petrov

Reputation: 318

I think for two possible solutions for this issue:

  1. File -> Invalidate Caches/Restart....

  2. Delete the folder caches inside .gradle and reopen the project. This way the Gradle will start downloading the dependencies and will cache them again.

Upvotes: 0

Related Questions