After updating some of our devices to android 8.0 , upon focusing on a TextInputEditText
field inside of a TextInputLayout
, the app crashes with th
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>
<style name="App_EditTextStyle" parent="@android:style/Widget.EditText">
<item name="android:importantForAutofill">noExcludeDescendants</item>
</style>
In this way you make this changes for all your EditTexts without needing to change your layout files.
I have also facing this issue and finally we got the reason of crash on android 8.0 and android 8.1.
first reason(important clue): empty hint(android:hint="") in xml leads to crash in oreo device.Please remove this empty hint in editText in whole project search.
second reason(same as above explain): make sure your editText hint should be show inside TextInputLayout if you have used TextInputLayout otherwise you can use hint inside editText.
Hope this helpe you !!
Thank you