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:

  • Faced the same issue, I guess its because I did a fresh install of the IDE and the first run is slow isn't it?
    anon 19 Sept 2020 10:32:01 GMT
  • Did not work for me? What may be the other reasons for this? Can you help?
    user135 07 Aug 2020 11:23:13 GMT
  • Ah! Thank you, had the same issue.
    user2934 02 Aug 2020 16:08:21 GMT
  • Further comments disabled!





Recent Posts:
Hello there!,

You are using AdBlocker!

I am an independent developer trying to help fellow developers and students to resolve issues faced on a day-to-day basis, we 'Code to Care' . There is a lot of expenses involved in hosting and managing a website that's the reason we have ads.

A humble request to you to disable adBlocker on Code2care.org and support us pay our bills.

Thanks,
Cod2ecare - Line's of code for change.

To see contents reload page after unblocking
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.