Android 8.0 Oreo crash on focusing TextInputEditText

I ran into this too. It turns out the issue was caused by setting the hint text on the EditText nested inside the TextInputLayout.

I did some digging and found this nugget in the 26.0.0 Beta 2 release notes.
Android Support Release Notes June 2017

TextInputLayout must set hints on onProvideAutofillStructure()

That led me to try setting the hint on the TextInputLayout instead of the nested EditText.

This resolved the crashing issue for me. Example:

    android:hint="Some Hint Text""true""true""16dp">



I posted this as an answer here as I mixed up bookmarks. Sorry for posting the same answer twice.

Add below mentioned attribute in your EditText:


Luke Simpson almost make it right, just should use “styles.xml” instead of “themes.xml”.

I created a new style file with version qualifier, aiming to v26, to make it clearer.
Just copy and paste your AppTheme for the v26/styles.xml and add editTextStyle items the EditTextStyle style.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:editTextStyle">@style/App_EditTextStyle</item>
    <item name="editTextStyle">@style/App_EditTextStyle</item>

<style name="App_EditTextStyle" parent="@android:style/Widget.EditText">
    <item name="android:importantForAutofill">noExcludeDescendants</item>

In this way you make this changes for all your EditTexts without needing to change your layout files.

Leave a Comment