InflateException on setContentView(R.layout.activity_login);

InflateException on setContentView(R.layout.activity_login);

我试图在我的三星 android 6.0 上打开我的应用程序;但它给了我这个例外:

11-15 17:29:40.751 11631-11631/? E/Zygote: v2
11-15 17:29:40.751 11631-11631/? E/Zygote: accessInfo : 0
11-15 17:29:41.251 11631-11631/com.example.meetgreet E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.meetgreet, PID: 11631
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.meetgreet/app.meetgreet.meetgreet.LoginActivity}: android.view.InflateException: Binary XML file line #61: Binary XML file line #61: Error inflating class <unknown>

但是在我的 activity_login.xml 第 61 行:

<androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/constraintLayout"
            android:layout_width="0dp"
            android:layout_height="62dp"
            android:layout_marginStart="8dp"
            android:layout_marginLeft="8dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="8dp"
            android:layout_marginRight="8dp"
            android:background="@drawable/layout_border"
            android:onClick="nextPhoneInput"
            android:padding="10dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/textView2">

我的 build.gradle 中也有 ConstraintLayout 实现:

implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

这个错误意味着 XML 布局中存在无效值

含义:-如果您尝试为尺寸值赋予颜色值,则会在布局中引发错误。此错误表明在给定的行中该值无效。我认为是在这一行

  app:layout_constraintEnd_toEndOf="parent"
  app:layout_constraintStart_toStartOf="parent"