Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I fix "Design editor is unavailable until a successful build" error?

I started to learn Android Studio. 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

How can I fix this error.

enter image description here

enter image description here

I just noticed that my xml code is causing error. Is that why this may be not working?

like image 686
SASPYTHON Avatar asked Nov 14 '17 15:11

SASPYTHON


People also ask

Why does gradle Sync Fail?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.

How do I sync gradle with Android Studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.


1 Answers

Go to File > Sync Project with Gradles Files.

like image 61
Fabrício Benvenutti Avatar answered Sep 17 '22 14:09

Fabrício Benvenutti