简体   繁体   English

Android Studio 3.6.1,未显示布局设计视图

[英]Android Studio 3.6.1, Layout Design View not showing

Since Android Studio v3.6.1, I can no longer preview my xml layout files.从 Android Studio v3.6.1 开始,我无法再预览我的 xml 布局文件。 I get "Waiting for build to finish" forever.我永远得到"Waiting for build to finish"

I found this post, which seems related, but the answers there didn't help.我找到了这篇似乎相关的帖子,但那里的答案没有帮助。 Android studio layout Design view not loading Android 工作室布局设计视图未加载

As I was suspecting a style/theme related problem, I opened up at least 10 of my older apps.当我怀疑与样式/主题相关的问题时,我打开了至少 10 个旧应用程序。 Unfortunately they all showed the same behaviour.不幸的是,他们都表现出相同的行为。

Here's a small screen shot - all my layout files look like this:这是一个小屏幕截图 - 我所有的布局文件如下所示: 在此处输入图片说明

UPDATE: since mid April 2020 com.google.android.material:material:1.2.0-alpha06 is available, and with that release my problems have gone更新:自 2020 年 4 月中旬以来 com.google.android.material:material:1.2.0-alpha06 可用,随着该版本的发布,我的问题已经消失


Finally found the problem.终于找到问题了。

I have been using the newest Material lib com.google.android.material:material:1.2.0-alpha05 for a new project.我一直在为一个新项目使用最新的 Material lib com.google.android.material:material:1.2.0-alpha05 This alpha state library generates a rendering error in the layout design view.此 alpha 状态库在布局设计视图中生成渲染错误。

Unfortunately this error makes the layout design view part of Android Studio crash, so that all your other layouts also fail showing their design view.不幸的是,此错误使 Android Studio 的布局设计视图部分崩溃,因此所有其他布局也无法显示其设计视图。

The best solution would be not to use this Alpha library in its newest version, but I need it for development.最好的解决方案是不要在最新版本中使用这个 Alpha 库,但我需要它来进行开发。 The 2nd best solution is to make sure to avoid opening the related layout files in design mode.第二个最佳解决方案是确保避免在设计模式下打开相关的布局文件。

Helpful for my finding was this: how to solve render problem Path.op() not supported?对我的发现有帮助的是: 如何解决不支持 Path.op() 的渲染问题?

i had a similar issue but i tried all the material design dependency libs and我有一个类似的问题,但我尝试了所有的材料设计依赖库和

implementation 'com.google.android.material:material:1.2.0-alpha02'

seems to work, resolved the issue and now i can see the xml renders on the preview and design.似乎工作,解决了问题,现在我可以在预览和设计中看到 xml 渲染。 dont forget to clean and rebuild project after updating app.gradle更新 app.gradle 后不要忘记清理和重建项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 工具栏未显示在 Android Studio 3.6.1 的布局编辑器中 - Toolbar not showing in the layout editor of Android Studio 3.6.1 Android Studio - TextView 未显示在设计视图布局中 - Android Studio - TextView not showing in design view layout Android Studio 3.6.1 的布局编辑器中缺少标记为“设计”和“文本”的选项卡 - Tabs labeled "Design" and "Text" missing in the layout editor in Android Studio 3.6.1 android studio 问题:复杂的布局未显示在设计视图中,而是显示为 XML - android studio issue: complex Layout is not showing in design view but just as XML Android Studio Layout 预览不显示设计 - Android Studio Layout preview not showing design Android Studio布局设计视图未加载 - Android studio layout Design view not loading 设计视图上未显示 EditText 框 - Android Studio - EditText box not showing on Design View - Android Studio 当我使用自动完成挂钩框架布局时,Android Studio 3.6.1 错误 - Android Studio 3.6.1 error when i hook frame layout with autocomplete android studio 3.6.1 中未显示布局预览工具栏 - Layout Preview toolbar doesn't show in android studio 3.6.1 android 工作室中的图像视图显示在 xml 布局中,但未显示在应用程序中 - Image view in android studio is showing in xml layout but not showing in app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM