Binary XML file line #28 in dev.prokrostinatorbl.raspisanie:layout/fragment_timetable_custom: Error inflating class

После того, как я создал разметки для разных размеров экрана(hdpi/mdpi и т.д.) приложение стало вылетать с данной ошибкой.

Process: dev.prokrostinatorbl.raspisanie, PID: 16424
android.view.InflateException: Binary XML file line #28 in dev.prokrostinatorbl.raspisanie:layout/fragment_timetable_custom: Binary XML file line #28 in dev.prokrostinatorbl.raspisanie:layout/fragment_timetable_custom: Error inflating class <unknown>
Caused by: android.view.InflateException: Binary XML file line #28 in dev.prokrostinatorbl.raspisanie:layout/fragment_timetable_custom: Error inflating class <unknown>
Caused by: java.lang.reflect.InvocationTargetException

Вот строка, которая вызывает данную ошибку:

final View view = getLayoutInflater().inflate(R.layout.fragment_timetable_custom, null);

Вот файл разметки:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:layout_marginBottom="10dp"
        android:layout_marginEnd="4dp"
        android:id="@+id/bg_par"
        tools:ignore="MissingConstraints">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_centerVertical="true"
            android:id="@+id/time_bg"
            android:background="@drawable/time_bg"
            android:layout_marginLeft="1dp"
            android:padding="6dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/start"
                android:text="12:20"
                android:layout_centerInParent="true"
                android:layout_alignParentLeft="true"
                android:textSize="12sp"
                android:textColor="?attr/colorPrimary"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/random_name"
                android:layout_centerInParent="true"
                android:layout_toRightOf="@+id/start"
                android:text=" - "
                android:textSize="12sp"
                android:textColor="?attr/colorPrimary"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/end"
                android:text="20:10"
                android:textSize="12sp"
                android:textColor="?attr/colorPrimary"/>

        </LinearLayout>
    

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_toEndOf="@+id/time_bg"
            android:orientation="horizontal"
            android:layout_marginStart="4dp"
            android:id="@+id/bg_par_fragment"
            android:background="@drawable/study_timetable_bg_standart">



            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1">

                <TextView
                    android:id="@+id/name_of_par"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="лек. Физика"
                    android:textStyle="bold"
                    android:layout_marginBottom="10dp"
                    android:paddingRight="6dp"
                    android:paddingLeft="6dp"
                    android:layout_marginTop="10dp"
                    android:textColor="?attr/colorAccent"
                    android:layout_centerInParent="true"
                    android:gravity="center"
                    android:textSize="16sp" />



            </RelativeLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_weight="1.8">


                <View
                    android:layout_width="1dp"
                    android:layout_height="match_parent"
                    android:background="?attr/colorAccent"/>

                <RelativeLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="10dp">

                    <RelativeLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerInParent="true">


                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:id="@+id/docent"
                            android:text="доц.каф. Андрухова Т.В."
                            android:textStyle="bold"
                            android:layout_alignParentStart="true"
                            android:layout_centerHorizontal="true"
                            android:gravity="center"
                            android:layout_marginTop="10dp"
                            android:textSize="14sp"
                            android:textColor="?attr/colorAccent"/>


                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:id="@+id/auditoria"
                            android:layout_below="@id/docent"
                            android:gravity="center"
                            android:layout_centerHorizontal="true"
                            android:text="400R"
                            android:textSize="14sp"
                            android:layout_marginBottom="10dp"
                            android:textColor="?attr/colorAccent"/>


                    </RelativeLayout>

                </RelativeLayout>


            </LinearLayout>




        </LinearLayout>



    </RelativeLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

Ответы (0 шт):