I had the same issue as shown in the screenshot of the OP. The solutions described in accepted answer just remove the underline which you wanted to customize. It would be ok to inherit the style from Widget.AppCompat.EditText but not theme. The fix is to remove inheritance from your CustomEditText:
Credits go to this answer