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

后端 未结 8 1436
夕颜
夕颜 2020-12-20 11:56

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.

<
相关标签:
8条回答
  • 2020-12-20 11:57

    For me I had this problem with one file, so I simply created a new one with the same code.

    0 讨论(0)
  • 2020-12-20 11:59

    Cleaning and rebuilding my project solved the issue.

    0 讨论(0)
  • 2020-12-20 12:03

    Try Clean and rebuild project.and Also try Invalidate caches/Restart.And this issue is also facing because of Low Ram in laptops.

    0 讨论(0)
  • 2020-12-20 12:04

    Simply make a build from within AS - not the command line. I get this all the time because I'm mostly using the command line. It's been like this since early versions of AS so I recon it's not high on there list of issues. Lately (3.2) there is a lot of new internal crashes and what not - not stable at all

    0 讨论(0)
  • 2020-12-20 12:05

    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.
    0 讨论(0)
  • 2020-12-20 12:11

    See my response on similar question posted:

    Android studio error java.lang.IllegalArgumentException: Resource name cannot be empty

    This error can occur when you update to Android Studio 3.0. It doesn't affect your ability to build a project, but the error does not allow you to visually see your xml layout files. You will also get the error when committing files to GIT, but you can still commit and push.

    What I found in one of my projects is that a file was added to the "menu" folder automatically upon Android Studio upgrade, and the file had no name. It was named simply ".xml". All you need to do is delete the file and clean your project, allowing a new build of the project. That should take care of the issue.

    0 讨论(0)
提交回复
热议问题