2

Android studio version

Android Studio Dolphin | 2021.3.1 Patch 1

Build #AI-213.7172.25.2113.9123335, built on September 30, 2022

Runtime version: 11.0.13+0-b1751.21-8125866 amd64

enter image description here There are even not showing any message, what the...?

Event log enter image description here

I have tried

After Update my Android Studio (Dolphin | 2021.3.1), XML Layout Preview Can't showing

Android Studio Dolphin | 2021.3.1 does not show layout preview

invalidated and restarted caches

but not working.Has anyone encountered it?

How to solve it? Any help will be appreciate.

GHH
  • 1,713
  • 1
  • 8
  • 21
  • Have a look at the Event Log (the red bubble in the lower right corner) Most of the time the is an issue with your layout when it can't be shown in the preview. – Stephan Nov 07 '22 at 08:46
  • @Stephan OK I updated the event log, please check it out, thanks. – GHH Nov 07 '22 at 08:49
  • The error there doesn't seem related to the issue. However maybe you get more information when you click the red question mark bubble on the upper right corner. – Stephan Nov 07 '22 at 09:19
  • @Stephan It show `java.lang.reflect.InvocationTargetException` and require me to refeash layout but when I click refresh still not working. – GHH Nov 07 '22 at 09:23
  • I see. It's hard to say what is going wrong. I suspect something is wrong with your layout file/code. Can you post the content of it? Does it happen to all layoutfiles, or only this one? Can you open a new project and see if the default layouts work? – Stephan Nov 07 '22 at 09:26
  • @Stephan After some time(Over 10mins), the xml preview appeared, and I didn't change any code or setting.It seems that the xml is rendering very slowly. – GHH Nov 07 '22 at 09:34

3 Answers3

1

The editor is probably unable to load the custom theme file.

First try to fix issues in your app theme file. (For me it was an empty item tag of fontFamily)

If unsuccessful, just select a different theme from the top toolbar menu of the designer.

Gradle is also a likely culprit so make sure that your gradle version is 7.4 and AGP is 7.3

enter image description here

FawwazFaisal
  • 57
  • 2
  • 11
1

I had the same problem. I think it was a bug in Android Studio. The only solution that worked for me was downgrading the Android Studio to Chipmunk (2021.2.1 Patch 2). You can find it here: https://developer.android.com/studio/archive

When installing another Android Studio, do not forget to uninstall the previous version. (You will have the option when the setup will be shown).

Thanks for the original answer to: https://stackoverflow.com/a/74903373/17596747

RasulOs
  • 41
  • 4
0

As of today, I have a new version of Android Studio available i.e Android Studio Flamingo | 2022.2.1 after updating to this version above issue has been resolved.

Asadullah Mumtaz
  • 171
  • 1
  • 14