如何修复“在成功构建之前无法使用设计编辑器",错误? [英] How can I fix "Design editor is unavailable until a successful build" error?

查看:544
本文介绍了如何修复“在成功构建之前无法使用设计编辑器",错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从昨天开始学习Android Studio.我尝试回显简单的"Hello World":

I started to learn Android Studio from yesterday. I try to echo out simple "Hello World":

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:id="@+id/activity_main"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="16dp"
    android:paddingBottom="16dp"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!" />

</RelativeLayout>

但是当我单击设计"视图时,是否显示此错误?

but when I clicked "design" view, this error is showing?

在成功构建之前,无法使用设计编辑器

Design editor is unavailable until a successful build

如何解决此错误.我昨天刚下载了Android Studio.

How Can I fix this error. I just downloaded Android Studio yesterday.

我刚刚注意到我的xml代码引起了错误.这就是为什么这可能行不通的原因.非常感谢

I just noticed that my xml code is causing error. that is why this may be not working. Thank you so much

推荐答案

转到文件">与Gradles文件同步项目".

Go to File > Sync Project with Gradles Files.

这篇关于如何修复“在成功构建之前无法使用设计编辑器",错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆