Home » Android » android – TextInputLayout Accessibility tests fails bacause "View is missing speakable text needed for a screen reader"-Exceptionshub

android – TextInputLayout Accessibility tests fails bacause "View is missing speakable text needed for a screen reader"-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

During testing of Accessibility, tests on EditText in TextInputLayout fail with “View is missing speakable text needed for a screen reader”. A similar issue is described here, but the proposed solutions with XML parameters do not help. I am using Material library (version: 1.1.0).

Layout part:

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/login_email_address"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/padding_l"
    android:layout_marginLeft="@dimen/padding_l"
    android:layout_marginStart="@dimen/padding_l"
    android:layout_marginRight="@dimen/padding_l"
    android:layout_marginEnd="@dimen/padding_l"
    android:labelFor="@id/login_email_address_edit_text"
    android:accessibilityHeading="true"
    android:contentDescription="@string/login_email_address"
    app:layout_constraintTop_toBottomOf="@id/login_error_message"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:errorTextAppearance="@style/ErrorText"
    app:errorEnabled="true">

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/login_email_address_edit_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="@dimen/edit_text_min_height"
        android:inputType="textEmailAddress"
        android:hint="@string/login_email_address" />

</com.google.android.material.textfield.TextInputLayout>
How to&Answers: