Android Studio Layout Preview stuck loading
Asked Answered
S

6

5

I'm having this problem with a new mac I got. The issue is that whenever I try to use the preview for layout or the design of the layout, I get the loading spinner that doesn't stop. It just keeps going. I've waited several minutes and nothing happens. It just keeps on spinning.

I've tried to invalidate my cache and restart android studio, but it freezes. Forcing me to force quit the application and restart it.

I've tried upgrading my Android Studio version to the latest (3.5 preview), but to no avail

I've tried changing all of the options like API, device, App Theme in the design

I'm currently using a Mac on 10.13.6

Searle answered 22/1, 2019 at 20:48 Comment(4)
Did you fix it? If yes, how did you achieved that?Nomism
I have not been able to fix it.Searle
In my case, I completely removed Android Studio (3.4.1) deleting the program config-related files (completely everything related to Android Studio), and reinstalled it, and now everything is working OK. (Using Windows 8.1 Pro x64 with Update 3) Note: Don't know if setting the JAVA_HOME variable for Mac could help in fixing your problem...Nomism
check my answer @JesúsHagiwaraPlumose
F
4

This below command helped me to fix the stucking issue:

rm -Rf ~/Library/Preferences/AndroidStudio*
rm -Rf ~/Library/Preferences/com.google.android.*
rm -Rf ~/Library/Preferences/com.android.*
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
Frontolysis answered 28/8, 2019 at 9:2 Comment(4)
helped me in android studio 3.6 previewAudiovisual
have you found a fix for 4.1.3? @Plumose I should of skipped the update :'(Amendment
@IanSmith... Please check my answer... It seems to work consistently for me.Plumose
Did not worked.Spectrogram
V
3

I had this issue but non of the above answers worked for me, this was how I solved it:

Your android studio will restart. If you are asked to import settings, select Do not import. I believe this issue is caused by a corrupt android studio settings so re-importing existing settings will lead to the same error.

For windows computers, the solution might just be to delete the android studio folder in your home directory that carries the version of android studio you're using.

Installing another version of android studio could also solve this issue only if you do not re-import your existing android studio settings.

Vale answered 17/4, 2021 at 22:14 Comment(1)
Funny but this really was only what worked .. tried multiple things..Spectrogram
P
1

Remove the project and Reimport the project again. It works for me :)

Plumose answered 7/4, 2021 at 14:24 Comment(0)
H
0

After opening your project on Android Studio, from your Mac's Menubar, navigate to

Files -> Sync Project with Gradle Files

Wait for the project to sync completely. Hope this helped.

Humpy answered 11/1, 2020 at 6:25 Comment(1)
Where is this magical 'Files' menu? Nothing under the 'File' menu says "Sync Project with Gradle Files"Amendment
P
0

It downloads the essential file for using layout as u can see it on the background tasks on the bottom right nearer to the corner. So loading signifies as it downloads some modules on background so just dont close the program

Parting answered 4/6, 2020 at 7:5 Comment(0)
T
0

On Koala Feature Drop | 2024.1.2 Patch 1 I got it working by the classic clearing of caches and restart.

Trimly answered 4/10, 2024 at 10:31 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.