Blank/No xml preview in Android Studio

Viewed 297

I have faced some Windows user profile corruption problem. However I have recovered that and opened Android Studio. In Android Studio previously it stuck at Initializing. Then I have reinstalled whole Android Studio. After installation and opening my project, XML preview looks like

this

Tried Solution:

  • Invalidate cache and restart
  • Clean/Rebuild project
  • Deleting cache from C:\Users\xxxxxx\.gradle\caches\ and .gradle & .idea from project folder
  • Downgrading androidx.appcompat:appcompat:1.3.0 to androidx.appcompat:appcompat:1.2.0
  • Resotre default (from Android Studio welcome page)
  • Enable and Disabling Experimental>Use new Layout Rendering Engine
  • Creating new project to check it is problem with engine(yes it is problem with engine not my project side)

Anyother solutions highly recomended.


Edit:

No error shown in IDE.

My Android Studio details

Android Studio 4.2.1

Build #AI-202.7660.26.42.7351085, built on May 10, 2021

Runtime version: 11.0.8+10-b944.6842174 amd64

VM: OpenJDK 64-Bit Server VM by N/A

Windows 10 10.0

GC: G1 Young Generation, G1 Old Generation

Memory: 1280M

Cores: 8

Registry: external.system.auto.import.disabled=true

Non-Bundled Plugins: org.jetbrains.kotlin

1 Answers

Okay, Finally found defect

Tip:

No error shown in IDE.

We can still find IDE Log for more details Help>Show Log in Explorer you can find idea.log. Check for error in idea.log

My case:

java.util.concurrent.CompletionException: java.io.FileNotFoundException: C:\Android\SDK\fonts\com.google.android.gms.fonts\directory\font_directory.xml (Access is denied)

As I said my user profile corrupted owner ship of C:\Android\ is not changed causing Access is denied

Solution:

  • Run Android Studio as Administrator or Change ownership of SDK.

Hope may help anyone

Related