Android XML layout preview not working in Android Studio Dolphin 2021.3.1 Patch 1

1.3k views Asked by At

Can anyone help how to resolve the preview issue for XML layout file?

enter image description hereenter image description here

4

There are 4 answers

0
Sohaib Ahmed On

Solution # 1

If you are using any Custom-View/Component-View, you must need to set a theme to that view.

Solution # 2

You need to fix these xml errors (maybe alt + enter help to fix them)

0
Hanif Shaikh On

Delete the .idea folder and restart Invalidate caches / Restart Android Studio.

0
Halil Ozel On

I was getting the same error in version. Android Studio Electric Eel | 2022.1.1 Patch 1

I did the following steps and only one worked for me:

  • Invalidate Caches ❌
  • Clean Project ❌
  • Rebuild Project ❌
  • Remove build Folder ❌
  • Remove .idea Folder ✅

enter image description here

Make sure you're using the Android Studio with the latest version.

enter image description here

0
BobTheCat On

Upgrade to Android Studio Flamingo | 2022.2.1. fix the problem.

enter image description here as you can see here https://developer.android.com/studio/releases/fixed-bugs/studio/2022.2.1

(from my experience, this issue occurred on Dolphin and Electric Eel. Before that, Chipmunk was fine)