Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.0 xml-layout file's preview not showing

When I open layout file in my new Android-Studio file and press preview tab it'll show a message Waiting for build to finish... for infinite time. enter image description here

Has anyone faced the same issue or any solution?

like image 439
Vikrant Shah Avatar asked Oct 31 '17 13:10

Vikrant Shah


People also ask

How do I view XML in preview?

View an XML file in a browser If all you need to do is view the data in an XML file, you're in luck. Just about every browser can open an XML file. In Chrome, just open a new tab and drag the XML file over. Alternatively, right click on the XML file and hover over "Open with" then click "Chrome".

Where is the layout editor in Android Studio?

To make room for the Layout Editor, hide the Project window. To do so, select View > Tool Windows > Project, or just click Project on the left side of the Android Studio screen. If your editor shows the XML source, click the Design tab at the top right of the window.


2 Answers

Cleaning and rebuilding my project solved the issue.

like image 69
Sumit Saurabh Avatar answered Nov 15 '22 20:11

Sumit Saurabh


try different theme (may be from Appcompat) and API level from top

OR

  1. If you have made some changes in the layout just undo it.
  2. delete .idea and .gradle folder from root of the project
  3. close android studio , restart it
  4. click on gradle icon from right sidebar and click sync icon to refresh project. now rebuild the project and it should work.
like image 31
44kksharma Avatar answered Nov 15 '22 18:11

44kksharma