i have created 4 activities they all were work well but suddenly the preview of design in XML file is not showing I have tried to reopen my android studio also that specific XML. but the problem is still here. XML code is showing but only the preview of design is not showing here the ss of screen. please check and help me to solve this out.
-
What does the error say? (Top right, red question mark) – Henry Twist Aug 03 '21 at 12:02
-
Are you using the latest android studio version? – noev Aug 03 '21 at 13:35
-
that error is about Rendering issue and it does not have any effect on application it works with that. – MUHAMMAD HASEEB Aug 03 '21 at 15:03
-
i have installed and start android this month so I think I have latest version. anyhow can you tell me how can I check for updates? – MUHAMMAD HASEEB Aug 03 '21 at 15:05
5 Answers
please try the following steps:
- clean project
- delete .idea and .gradle file
- remove app/build folder
- now do invalid cache and restart
if still your problem is not solved then try to restart your computer

- 21
- 3
I have tried all the method from above, unfortunately, nothing work.
Upgrade to Android Studio Flamingo | 2022.2.1. fix the problem.
(from my experience, this issue occurred on Dolphin and Electric Eel. Before that, Chipmunk was fine)

- 470
- 4
- 11
you just need to do invalidate Caches and restart, I have provided an image for you to know what to do exactly. in android studio, go to the top left corner and select file and click on Invalidate Caches/restart and that will restart your android studio. than try to open your xml layout.

- 11,053
- 14
- 62
- 116

- 51
- 4
-
-
please try to this. .In android studio top right corner above layout display there is Toggle issue panel click on that and u will see one box in the bottom showing rendering issue restart rendering engine and that will restart your android studio. try this solution. – Kevin Patel Aug 03 '21 at 16:06
-
-
1@MUHAMMADHASEEB Did you get any solution for same defect because i am facing same issue and not able to resolve . – Manisha Oct 03 '22 at 09:33
This is a log on StackOverFlow for those who continue to have problems after doing a clean build, invalidating caches and restarting, and restarting the computer.
Check if the element of the view has a custom view imported from an external library.
Ex. In my case, I was using YouTubePlayerView of YouTubeAPI.
Obviously, the preview worked fine until Chipmunk.
However, the preview has not been released since Dolphin.
So I annotated the YouTube player view.
Then the preview was displayed normally.
In fact, I've confirmed that other people are experiencing the same problem as above.
So my guess is that custom views from libraries that are no longer updated as Gradle versions go up are not compatible with each other.
In that case It seems to be a problem caused by using an external library view called de.hdodenhof. enter image description here

- 41
- 2
I came to the solution of mia. She suggests to use
implementation 'com.google.android.material:material:1.8.0-alpha01'
in the apps build.gradle.
This bug appeared initially to me with version 1.8.0
. Also tried unsuccessfully with versions 1.8.0-alpha02
and 1.9.0-beta01
.

- 951
- 1
- 15
- 36