【问题标题】:Blank/No xml preview in Android StudioAndroid Studio 中的空白/无 xml 预览
【发布时间】:2021-06-17 15:07:39
【问题描述】:

我遇到了一些 Windows 用户配置文件损坏问题。但是我已经恢复了它并打开了 Android Studio。在之前的 Android Studio 中,它停留在初始化。然后我重新安装了整个 Android Studio。安装并打开我的项目后,XML 预览看起来像

尝试过的解决方案

  • 使缓存失效并重新启动
  • 清理/重建项目
  • 从项目文件夹的C:\Users\xxxxxx\.gradle\caches\.gradle.idea 中删除缓存
  • androidx.appcompat:appcompat:1.3.0 降级为androidx.appcompat:appcompat:1.2.0
  • 恢复默认设置(来自 Android Studio 欢迎页面)
  • 启用和禁用Experimental>Use new Layout Rendering Engine
  • 创建新项目以检查引擎是否存在问题(是的,这是引擎问题,而不是我的项目方)

强烈推荐的任何其他解决方案。


编辑:

IDE 中没有显示错误。

我的 Android Studio 详情

Android Studio 4.2.1

构建 #AI-202.7660.26.42.7351085,构建于 2021 年 5 月 10 日

运行时版本:11.0.8+10-b944.6842174 amd64

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

Windows 10 10.0

GC:G1年轻代,G1老年代

内存:1280M

核心数:8

注册表:external.system.auto.import.disabled=true

非捆绑插件:org.jetbrains.kotlin

【问题讨论】:

    标签: android android-studio


    【解决方案1】:

    好的,终于找到缺陷了

    提示:

    IDE 中没有显示错误。

    我们仍然可以找到 IDE 日志以获取更多详细信息Help>Show Log in Explorer,您可以找到idea.log。检查idea.log中的错误

    我的情况:

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

    正如我所说,我的用户资料已损坏 C:\Android\ 的所有权没有改变,导致 Access is denied

    解决方案:

    • Administrator 运行Android Studio 或更改SDK 的ownership

    希望可以帮助任何人

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-30
      • 1970-01-01
      • 2019-09-28
      • 1970-01-01
      相关资源
      最近更新 更多