How can I fix the error "Design editor is not available until the successful assembly"?

I started learning Android Studio from yesterday. I am trying to repeat a 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 the “design” view, does this error show?

Design Editor Unavailable until Build Successful

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

enter image description here

enter image description here

I just noticed that my XML code is causing an error. that is why it may not work. thank you so much

+79
source share
16 answers

Go to File> Sync Project with Gradles Files.

+277
source

It works for me

File> Sync Project With Gradle Files

enter image description here

+38
source

Exit Android Studio (do not close the project. Quit from Android Studio ), then open the project and go to Android Studio > Build > Clean Project

Then Android Studio > File > Sync Project with Gradles Files as Android Studio > File > Sync Project with Gradles Files below.

enter image description here

If your problem still exists, select the Install Android Studio > File > Sync Project with Gradles Files tool, like Android Studio > File > Sync Project with Gradles Files below, and then Android Studio > File > Sync Project with Gradles Files

enter image description here

+30
source

I encountered the same problem even after repeatedly recovering my project. I closed the project and opened again, the problem is solved.

+17
source

None of the above helped me. what worked for me is to go to File → Invalidate Caches/Restart

+14
source

A simple solution this will work for sure

1.Select - >> File from the menu bar and 2.Click On-- >> Synchronize the project with the Gradle file.

Thank you

@Ambilpura Sunil

+10
source

Just restart Android Studio. In my case, I was offline before launching Android Studio, but online when I restarted.

+6
source

Do it

Assembly → Project Reconstruction

+4
source

Go online before starting an android studio. Then go to File-> New Project. Follow the instructions on the screen. Then wait. It will download the necessary files over the Internet. And that should fix it.

+3
source

Install the missing platforms and sync the project [press to install automatically]

+3
source

I had a problem after adding a line to my build.gradle file.

 compile 'com.balysv:material-ripple:1.0.2' 

Solution: I changed this line to

 implementation 'com.balysv:material-ripple:1.0.2' 

and then click sync again .

TA-dah! everything worked again.

+2
source

Edit the xml file in Notepad ++ and create it again. It works for me

0
source

I tried to change the SDK version:

Check out the image below: in this I changed 27 with Android P

Image

Hope this will be helpful for you.

0
source

In my case, it was because I didn’t like the fact that I left minSDK and targetSdk in the manifest. Go figure it out.

0
source

just click on the file in your Android studio and then click on “Sync project with Gradle files”.

if this does not work, click Build, click Clean Project.

it always works for me

0
source

You can clear the project from the build menu.

-1
source

Source: https://habr.com/ru/post/1273361/


All Articles