title: Binary XML file line #28: Error inflating class android.widget.TextView
body: <p>This is my layout:-  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#fdfdfe"
  tools:context=".activity.LoginActivity"&gt;
  
  &lt;androidx.core.widget.NestedScrollView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_above="@+id/bottom_lay_login"
      android:fillViewport="true"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"
          android:padding="42sp"&gt;
  
          &lt;ImageView
              android:layout_width="80dp"
              android:layout_height="80dp"
              android:layout_gravity="center"
              android:layout_marginTop="42sp"
              android:src="@drawable/foodx_restaurant_logo" /&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="42sp"
              android:text="@string/enter_the_details_to_login"
              android:textColor="@color/colorPrimaryText"
              android:textSize="13sp" /&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="42sp"
              android:text="@string/email"
              android:textColor="@color/colorPrimaryText"
              android:textSize="10sp" /&gt;
  
          &lt;EditText
              android:id="@+id/et_email"
              android:layout_width="match_parent"
              android:layout_height="32sp"
              android:layout_marginTop="4sp"
              android:background="@drawable/edit_text_rounded_corner_bg"
              android:imeOptions="actionNext"
              android:inputType="textEmailAddress"
              android:padding="4sp"
              android:textColor="@color/colorSecondaryText"
              android:textSize="13sp" /&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="42sp"
              android:text="@string/password"
              android:textColor="@color/colorPrimaryText"
              android:textSize="10sp" /&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="4sp"
              android:background="@drawable/edit_text_rounded_corner_bg"
              android:orientation="horizontal"&gt;
  
              &lt;EditText
                  android:id="@+id/et_password"
                  android:layout_width="match_parent"
                  android:layout_height="32sp"
                  android:layout_weight="1"
                  android:background="@null"
                  android:hint="@string/password"
                  android:imeOptions="actionDone"
                  android:inputType="textWebPassword"
                  android:padding="4sp"
                  android:textColor="@color/colorSecondaryText"
                  android:textSize="13sp" /&gt;
  
              &lt;ImageView
                  android:id="@+id/et_password_eye_img"
                  android:layout_width="30sp"
                  android:layout_height="match_parent"
                  android:layout_marginRight="4sp"
                  android:contentDescription="@string/app_name"
                  android:padding="4sp"
                  android:src="@drawable/ic_eye_open"
                  android:tint="@color/grey" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;TextView
              android:id="@+id/txt_forgot_password"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:padding="42sp"
              android:text="@string/forgot_password"
              android:textColor="@color/colorTheme"
              android:textSize="13sp" /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/androidx.core.widget.NestedScrollView&gt;
  
  &lt;LinearLayout
      android:id="@+id/bottom_lay_login"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_marginStart="42sp"
      android:layout_marginEnd="42sp"
      android:orientation="vertical"&gt;
  
      &lt;Button
          android:id="@+id/login_btn"
          android:layout_width="match_parent"
          android:layout_height="42sp"
          android:layout_marginTop="42sp"
          android:background="@drawable/rounded_button"
          android:text="@string/login"
          android:textColor="@color/colorWhite" /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:gravity="center"
          android:orientation="horizontal"&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/donot_have_an_account"
              android:textColor="@color/colorPrimaryText"
              android:textSize="10sp" /&gt;
  
          &lt;TextView
              android:id="@+id/txt_register"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:paddingLeft="42sp"
              android:paddingTop="42sp"
              android:paddingBottom="42sp"
              android:text="@string/register"
              android:textAllCaps="false"
              android:textColor="@color/colorTheme"
              android:textSize="10sp" /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>These are my logs:-</p>
  
  <pre><code>Caused by: android.view.InflateException: Binary XML file line #28 in com.dw.foodxrestaurant:layout/activity_login: Binary XML file line #28 in com.dw.foodxrestaurant:layout/activity_login: Error inflating class TextView
       Caused by: android.view.InflateException: Binary XML file line #28 in com.dw.foodxrestaurant:layout/activity_login: Error inflating class TextView
       Caused by: java.lang.IndexOutOfBoundsException: index=0 out of bounds (limit=0, nb=4)
          at java.nio.Buffer.checkIndex(Buffer.java:564)
          at java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:570)
          at android.graphics.fonts.FontFileUtil.analyzeStyle(FontFileUtil.java:94)
          at android.graphics.fonts.Font$Builder.build(Font.java:364)
          at android.graphics.Typeface$Builder.build(Typeface.java:596)
          at android.content.res.ResourcesImpl.loadFont(ResourcesImpl.java:1032)
          at android.content.res.Resources.getFont(Resources.java:408)
          at android.content.res.TypedArray.getFont(TypedArray.java:1035)
          at android.widget.TextView.readTextAppearance(TextView.java:4029)
          at android.widget.TextView.&lt;init&gt;(TextView.java:1079)
          at android.widget.TextView.&lt;init&gt;(TextView.java:978)
          at androidx.appcompat.widget.AppCompatTextView.&lt;init&gt;(AppCompatTextView.java:99)
          at androidx.appcompat.widget.AppCompatTextView.&lt;init&gt;(AppCompatTextView.java:95)
          at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:182)
          at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
          at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1407)
          at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1457)
          at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1063)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:999)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:963)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:1125)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1086)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:1128)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1086)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:1128)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1086)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
          at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
          at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
          at com.dw.foodxrestaurant.activity.LoginActivity.onCreate(LoginActivity.java:76)
  </code></pre>
  
  <p>I am unable to get the problems but I have checked all my libraries are up to date, Clean project and also invalidate and restart my studio.</p>
  
  <p>Note:- Devices till android 9 are working fine with the same code but android 10 is giving me error</p>