warrior3hsan
warrior3hsan

Reputation: 175

Android Studio Layout preview not showing design

I am currently working on a project and everything was fine. Today, while I opened android studio, the design/layout preview showing white screen only. (Like the picture)

I did try:

  1. Invalidate Cache and Restart
  2. Force Layout Refresh
  3. Downgrading appcombat to 27.1.1
  4. Adding Base.Theme in style.xml

But, nothing worked. No Build errors, runs fine in emulator and design shows in emulator, but not in android studio.

Any solution would be a great help, also let me know if you need more details.

enter image description here

Even a new project with Hello World layout appears same. Tried, uninstalling and installing Android Studio. enter image description here

Upvotes: 2

Views: 19065

Answers (6)

Sachin
Sachin

Reputation: 49

I just created a new Project and copied all the code based into the new project and then it was working fine.

Upvotes: -1

Vishal Kumar
Vishal Kumar

Reputation: 71

If you have tried all the solution and still problem is not solved the try doing this- just disable the toggle icon (top right icon) in xml as your layout would be visible in only night mode. enter image description here

Upvotes: 0

Anorov Hasan
Anorov Hasan

Reputation: 183

Try these, they are worked for me :

1.Rebuild project Buil > Rebuild project

  1. Invalidate and caches

  2. Gradale synch Setting>Synch project with gradle files

Upvotes: 0

Sumit Monapara
Sumit Monapara

Reputation: 840

Chenge the theme in the design screen,and you can see your perview.

enter image description here

Upvotes: 8

VikaS GuttE
VikaS GuttE

Reputation: 1704

I was also facing same issue resolved following this steps: https://www.youtube.com/watch?v=hMbIUVogWTo

In short answer is change appcompact-v7 "beta01" to "alpha1"

Upvotes: 0

warrior3hsan
warrior3hsan

Reputation: 175

I don't know what was wrong, but below steps solved my problem:

  1. Clear caches folder from C:/Users//.grade/caches
  2. Clear caches folder from C:/Users//.AndroidStuido3.x/system/caches
  3. Restart Android Studio
  4. Clean build project

After hours of experimenting and going through lots of solutions, this was the one that actually worked.

Hope anyone in the future faces this problem will find this helpful.

Upvotes: 7

Related Questions