What is the fundamental difference between the two layout file?

this is the first
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.coordinatorlayout 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:layout_width="parent" android:layout_height="parent" tools:context="com.example.roman.tit.MainActivity">

 <android.support.design.widget.appbarlayout android:layout_width="parent" android:layout_height="wrap content" android:theme="@style/AppTheme.AppBarOverlay">

 <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popuptheme="@style/AppTheme.PopupOverlay">

</android.support.v7.widget.toolbar></android.support.design.widget.appbarlayout>

 <include layout="@layout/content_main">

 <android.support.design.widget.floatingactionbutton android:id="@+id/fab" android:layout_width="wrap content" android:layout_height="wrap content" android:layout_gravity="bottom|end" android:parent="@dimen/fab_margin" app:srccompat="@android:drawable/ic_dialog_email">

</android.support.design.widget.floatingactionbutton></include></android.support.design.widget.coordinatorlayout>

and the second
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.constraintlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="parent" android:layout_height="parent">

</android.support.constraint.constraintlayout>


the first works fine, but the second crashes. Can't understand why.
PS please do not swear much, as Android I'm studying the first week
June 10th 19 at 16:34
1 answer
June 10th 19 at 16:36
Solution
android:layout_width mandatory attribute
Thank you very much! It worked!!! - Golda48 commented on June 10th 19 at 16:39

Find more questions by tags Android