Getting the same error "inflating class TextView" only for the Nexus 5X

120 Views Asked by At

My app is currently live and on one specific device, the Nexus 5X there is the following crash:

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kaisergames.guessIt/com.kaisergames.guessIt.LoginRegistration.SignInActivity}: android.view.InflateException: Binary XML file line #93: Binary XML file line #93: Error inflating class TextView
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
       at android.app.ActivityThread.-wrap11()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6494)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

I know there are some solutions to this problem but I checked all of them and nothing worked. I also cannot reproduce this error on the 5X emulator. On all other devices this error does not come up. The line #93 is the second TextView of the xml file, so there should be a problem in my xml file. There is a dimen value of the text size called @dimen/text_small_size, but this is defined in all my dimen files:


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/layout_sign_in"
    style="@style/AppBackground"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="2"
    tools:ignore="ContentDescription">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.9"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:id="@+id/text_login"
            style="@style/TextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="40dp"
            android:gravity="center_horizontal"
            android:text="@string/guess_it"
            android:textSize="35sp" />

        <ImageView
            android:id="@+id/app_logo_log_in"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_gravity="center"
            android:scaleType="centerInside"
            android:src="@drawable/guess_it" />

        <ProgressBar
            android:id="@+id/progress_bar_sign_in"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="20dp"
            android:visibility="invisible" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1.1"
        android:gravity="bottom"
        android:orientation="vertical"
        android:weightSum="3">

        <androidx.cardview.widget.CardView
            android:id="@+id/cv_login_email"
            style="@style/CardViewLogin"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="26dp"
            android:layout_marginEnd="26dp"
            android:layout_marginBottom="40dp"
            app:cardBackgroundColor="#C20E14">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageView
                    android:id="@+id/image_login_mail"
                    android:layout_width="40dp"
                    android:layout_height="wrap_content"
                    android:layout_alignTop="@+id/tv_login_email"
                    android:layout_alignBottom="@+id/tv_login_email"
                    android:layout_alignParentStart="true"
                    android:layout_marginStart="20dp"
                    android:layout_marginTop="-6dp"
                    android:layout_marginBottom="-6dp"
                    android:src="@drawable/ic_mail" />

                <TextView
                    android:id="@+id/tv_login_email"
                    style="@style/TextView"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_toEndOf="@+id/image_login_mail"
                    android:layout_marginTop="14dp"
                    android:layout_marginBottom="14dp"
                    android:layout_marginStart="30dp"
                    android:text="Mit E-Mail anmelden"
                    android:textSize="@dimen/text_small_size" />

            </RelativeLayout>

        </androidx.cardview.widget.CardView>

        <androidx.cardview.widget.CardView
            android:id="@+id/cv_login_facebook"
            style="@style/CardViewLogin"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="26dp"
            android:layout_marginEnd="26dp"
            android:layout_marginBottom="40dp"
            app:cardBackgroundColor="#3C5A99">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageView
                    android:id="@+id/image_login_facebook"
                    android:layout_width="40dp"
                    android:layout_height="wrap_content"
                    android:layout_alignTop="@+id/tv_login_facebook"
                    android:layout_alignBottom="@+id/tv_login_facebook"
                    android:layout_alignParentStart="true"
                    android:layout_marginStart="20dp"
                    android:layout_marginTop="-6dp"
                    android:layout_marginBottom="-6dp"
                    android:src="@drawable/ic_facebook" />

                <TextView
                    android:id="@+id/tv_login_facebook"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_toEndOf="@+id/image_login_facebook"
                    android:layout_marginTop="14dp"
                    android:layout_marginBottom="14dp"
                    android:layout_marginStart="30dp"
                    android:fontFamily="@font/actor"
                    android:text="Mit Facebook anmelden"
                    android:textColor="#FFFFFF"
                    android:textSize="@dimen/text_small_size" />

            </RelativeLayout>

        </androidx.cardview.widget.CardView>

        <androidx.cardview.widget.CardView
            android:id="@+id/login_google"
            style="@style/CardViewLogin"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="26dp"
            android:layout_marginEnd="26dp"
            android:layout_marginBottom="40dp">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageView
                    android:id="@+id/image_login_google"
                    android:layout_width="40dp"
                    android:layout_height="wrap_content"
                    android:layout_alignTop="@+id/tv_login_google"
                    android:layout_alignBottom="@+id/tv_login_google"
                    android:layout_alignParentStart="true"
                    android:layout_marginStart="20dp"
                    android:layout_marginTop="-6dp"
                    android:layout_marginBottom="-6dp"
                    android:src="@drawable/ic_brand" />

                <TextView
                    style="@style/TextView"
                    android:id="@+id/tv_login_google"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_toEndOf="@+id/image_login_google"
                    android:layout_marginTop="14dp"
                    android:layout_marginBottom="14dp"
                    android:layout_marginStart="30dp"
                    android:fontFamily="@font/actor"
                    android:text="Mit Google anmelden"
                    android:textSize="@dimen/text_small_size" />

            </RelativeLayout>

        </androidx.cardview.widget.CardView>

    </LinearLayout>

</LinearLayout>

All the dimens files are present as they should be.

I have the dimens.xml, dimens.xml (hdpi), dimens.xml (xhdpi), dimens.xml (xxhdpi).

I hope somebody can give me a hint to the solution.

0

There are 0 best solutions below