1

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?

WoW
  • 151
  • 2
  • 10
  • 1
    Create new project (with same package and project name) and copy-paste old project's files into newly created project. Don't copy-paste all the folders at a time, start copy-pasting one by one. – Shashanth Oct 24 '18 at 08:35
  • I will try to do that but for as a last option :/ – WoW Oct 24 '18 at 09:20
  • 1
    @Shashanth At the end that did helped , thanks! – WoW Oct 24 '18 at 10:32
  • Glad to here that! Happy coding – Shashanth Oct 24 '18 at 12:05
  • Possible duplicate of [Android Studio shows wrong file contents](https://stackoverflow.com/questions/53249677/android-studio-shows-wrong-file-contents) – Zoe May 15 '19 at 19:55

3 Answers3

2

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.

Anna
  • 532
  • 4
  • 14
1

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)

0

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.

Slavi Petrov
  • 320
  • 6
  • 12