Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Layout preview not working in Android Studio

I ported an android project from Eclipse to Android Studio. The project builds just fine. However I am not able to see any layout preview. When I go to the Design tab of a layout I get a

Loading Configuration...

message that never goes away (see image).

enter image description here
I have set correctly the Android SDK in the project structure. This happens with all the xml files and I am not able to open the "Preview" window from

View -> Tool Windows -> Preview

I tried creating a new project and everything was showing fine. Am I missing something? Anyone faced a similar issue? Is there a chance that this is happening because the folder structure is not the default one? (The layouts are not under project/src/main/res/layout but under project/res/layout)

like image 871
Thomas Kaliakos Avatar asked Jun 28 '13 12:06

Thomas Kaliakos


People also ask

Why layout is not Showing in Android Studio?

Methods to Solve the Problem To start with it, firstly we have to go settings that are present in the file or you can also use a shortcut of Ctrl+Alt+S. After clicking on settings, a new window will appear showing you all the settings that you can change.

Where is the component tree in Android Studio?

If you are looking for the component tree, go on the bottom left of Android Studio then click on the square (the one who show/hide the tool on the left, bottom and right) then on Designer. A new tab should be on the right part of android studio, with gradle and maver project.


2 Answers

Try this

  1. Build> Clean Project
  2. Build> Rebuild Project

It worked for me

like image 163
kishan Avatar answered Oct 05 '22 07:10

kishan


Just do a right click on the layout preview and click on

Show Included in contentmain.xml

you can see it in the following image enter image description here

like image 34
Elham Kohestani Avatar answered Oct 05 '22 06:10

Elham Kohestani