Android Studio 布局无法预览的问题:Access from Event Dispatch Thread (EDT) is not allowed

Android Studio 布局无法预览的问题:Access from Event Dispatch Thread (EDT) is not allowed
!-- 原来是这样 --androidx.constraintlayout.widget.ConstraintLayoutxmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:apphttp://schemas.android.com/apk/res-autoxmlns:toolshttp://schemas.android.com/toolsandroid:idid/mainandroid:layout_widthmatch_parentandroid:layout_heightmatch_parenttools:context.activity.MainActivityButtonandroid:idid/btn_go_testandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:text前往测试//androidx.constraintlayout.widget.ConstraintLayout!-- 修改成这样 --androidx.constraintlayout.widget.ConstraintLayoutxmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:apphttp://schemas.android.com/apk/res-autoxmlns:toolshttp://schemas.android.com/toolsandroid:idid/mainandroid:layout_widthmatch_parentandroid:layout_heightmatch_parenttools:context.activity.MainActivityButtonandroid:idid/btn_go_testandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:text前往测试app:layout_constraintBottom_toBottomOfparent//androidx.constraintlayout.widget.ConstraintLayout对上述布局代码进行修改之后Android Studio 出现如下错误信息同时无法预览布局com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Access from Event Dispatch Thread (EDT) is not allowed; see https://jb.gg/ij-platform-threading for details Current thread: Thread[#57,AWT-EventQueue-0,10,main] 254734910 (EventQueue.isDispatchThread()true) SystemEventQueueThread: (same)问题原因这个错误是 Android Studio 的一个 Bug与布局代码本身无关处理策略清理项目Clean Project即可正常预览布局