Reputation: 1
I am working on a project and am getting an error for unexpected end of file and cannot find the source. I am fairly new to Android Studio so I am lost as to where it is not closing. I've tried different closing tags to no avail, so I am not sure where to close it. Any tips and solutions are appreciated!
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:orientation="vertical"
android:padding="20dp"
tools:context=".VendorForm">
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:src="@drawable/njftrus"
android:transitionName="logo_image" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-20dp"
android:fontFamily="@font/bungee"
android:text="Welcome,"
android:textColor="#000"
android:textSize="40sp"
android:transitionName="logo_text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter information about you and your truck!"
android:textSize="18sp"
android:transitionName="logo_desc" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/reg_name"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Full Name">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/reg_truckname"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Truck Name"
app:counterMaxLength="15">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/reg_email"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress" />
com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/reg_phoneNo"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Phone No">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number" />
com.google.android.material.textfield.TextInputLayout>
<Button
android:id="@+id/reg_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000"
android:text="SAVE"
android:textColor="#fff"
android:transitionName="button_tran" />
LinearLayout>
Upvotes: 0
Views: 107
Reputation: 385
All com.google.android.material.textfield.TextInputLayout
are incorrectly closed,
this is a basic xml.
You can either close the tag with />
or if needed to have a child use </tag>
For example:
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/reg_truckname"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Truck Name"
app:counterMaxLength="15">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
Same goes for the very bottom LinearLayout
Basic tutorial: Android Developers - Declaring Layout (XML)
Upvotes: 1