skip to Main Content

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.

split_mode of Xml file

design_mode of XML file.

5

Answers


  1. 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.

    Image

    Login or Signup to reply.
  2. please try the following steps:

    1. clean project
    2. delete .idea and .gradle file
    3. remove app/build folder
    4. now do invalid cache and restart

    if still your problem is not solved then try to restart your computer

    Login or Signup to reply.
  3. 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

    Login or Signup to reply.
  4. 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.

    Login or Signup to reply.
  5. I have tried all the method from above, unfortunately, nothing work.

    Upgrade to Android Studio Flamingo | 2022.2.1. fix the problem.
    enter image description here

    (from my experience, this issue occurred on Dolphin and Electric Eel. Before that, Chipmunk was fine)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search