Android activity main xml stuck loading


While recently working on the new Android Studio 4.X, I can across an issue where when I clicked on the activity_main.xml resource file, it did not open instead I could see a loading icon stuck in an infinite loop. I was able to resolve it and seems below could be one of the reasons if you too are facing the same issue.

If you see the above screenshot, you could see that I have two processes running, the top process is trying to download Gradle packages and the bottom one says "indexing paused due to Import "MyApp" Gradle project". So that means the project is not indexed yet and waiting for the above process to complete.

Solution:

I waited for Gradle process to complete - it took ~10 mins and I was able to open activity_main.xml again :)


Comments:

  • Ah! Thank you, had the same issue.
    user2934 02 Aug 2020 16:08:21 GMT
  • Further comments disabled!