Android Studio xml design doesn't show anything, only a rect. and no error ,no issues

Viewed 31

Toady, I found my AS xml design not worked. It doesn't show anything enter image description here

And this project can build successfully, install apk also successfully, gradle sync,clean porject and rebuild project also successfully too. But the design widow doesn't show anything, I have tried change theme in style.xml, change theme in AS settings, uninstall AS, reinstanll AS(3.6.3, 2020.3.1Fox, 2021.3.1), but not resolve this problem。I've tried everything I can think of。 And i found a difference on AS 3.6.3, on this idea, the project also can run, gradle sync successfully, but design window always show “waiting for build finish”, but this project already build successfully。 enter image description here

Can anyone help me? Thank you very munch。

1 Answers

Android Studio makes a lot of files like caches and does not delete them. This can cause a problem when there is a need to make new files, so clearing caches will clear the old cache and make Android Studio faster. So to Invalidate caches/ Restart, go to the file which is present in the top menu bar in Android Studio and then click on the option “Invalidate Caches/Restart…” present in the Dropdown. After that it will ask you that “Would you like to continue?”, click on Invalidate and Restart button. Below are the links from geeksforgeeks https://www.geeksforgeeks.org/different-ways-to-fix-android-studio-does-not-show-layout-preview/

Related