"Index: 0, Size: 0 View draw error" Android Studio design tab error

Viewed 1077

I've recently updated my AS to 4.0 version. After that I put an EditText and a TextView inside of my layout, which looks like this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:text="EditText should be below me!"
        android:textSize="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="I'm a hint"/>

</LinearLayout>

However, the design tab doesn't show me the EditText at all! Design tab without the input field

At the bottom of the screenshot, you can see error. Googling it didn't help me, everything I found is Design in Android studio error Index:0 size:0.... View draw failed question, which has no answer.

What I've already done

I invalidated caches and restarted my AS but it didn't help. Also, I've changed the app's theme from

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

to

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

which had no impact. However, once I managed to change it to something like a button element style and it worked, even though it's not the solution I'm looking for. If I explicitly change the style of the EditText to things like

@style/Widget.AppCompat.Button.ButtonBar.AlertDialog

or

@style/Widget.AppCompat.Button.Borderless

I can see the EditText...

I'll appreciate any help you give me, guys. Thanks in advance!

UPDATE:

It's possible to fix the problem by switching on the "Use new Layout Rendering Engine" in the settings of the AS.

Fix

Anyway, I hope we're able to find this thing out and fix it, guys. Thank you for your attention!

0 Answers
Related