Calculator App layout

i have no error in my xml file but when i a running on my phone after all phases when it comes to Run Task i have been showing this error

Android resource compilation failed
G:\MyAssingment1\app\src\main\res\layout\activity_main.xml:72: error: not well-formed (invalid token).
G:\MyAssingment1\app\src\main\res\layout\activity_main.xml: error: file failed to compile.

i am unable to resolve this error from which line it is coming.

This error is coming from 72 line no. of your activity_main.xml

which type of error it is ?
because at 72 line the code is
android:text="<–"

Can you share the complete xml file here

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

<?xml version="1.0" encoding="utf-8"?>
<EditText
    android:id="@+id/et1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_marginTop="109dp"
    android:background="#bababa"
    android:cursorVisible="false"
    android:ems="10"
    android:inputType="number"
    android:text="0"
    android:textAlignment="textEnd"
    android:textColor="#1B2631"
    android:textSize="40sp"
    android:autofillHints="" tools:targetApi="o" />

<Button
    android:id="@+id/b1"
    android:layout_width="76dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/et1"
    android:layout_alignParentLeft="true"
    android:layout_marginStart="15pt"
    android:layout_marginLeft="35dp"
    android:layout_marginTop="70dp"
    android:layout_marginEnd="15pt"
    android:layout_marginRight="15pt"
    android:layout_marginBottom="15pt"
    android:background="#283747"
    android:text="C"
    android:textColor="#bababa"
    android:textSize="15pt"
    tools:ignore="RtlHardcoded" />


<Button
    android:layout_width="76dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/et1"
    android:layout_alignRight="@+id/b1"
    android:layout_marginLeft="35dp"
    android:layout_marginTop="70dp"
    android:layout_marginRight="-94dp"
    android:background="#283747"
    android:text="+/-"
    android:textColor="#bababa"
    android:textSize="15pt"
    android:id="@+id/bt3"
    tools:ignore="RtlHardcoded"/>
<Button
    android:id="@+id/bt4"
    android:layout_width="76dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/et1"
    android:layout_alignEnd="@+id/bt2"
    android:layout_marginTop="66dp"
    android:background="#283747"
    android:text="+"
    android:textColor="#bababa"
    android:layout_marginRight="-95dp"
    android:textSize="15pt"
    tools:ignore="RtlHardcoded"/>

Your layout doesn’t have a root tag like coordinatorlayout, linearlayout or framelayout

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout 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="#333333"
android:textDirection=“locale”
android:transitionGroup=“false”
tools:context=".MainActivity"
android:backgroundTint="#1B2631">

<EditText
    android:id="@+id/et1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_marginTop="109dp"
    android:background="#bababa"
    android:cursorVisible="false"
    android:ems="10"
    android:inputType="number"
    android:text="0"
    android:textAlignment="textEnd"
    android:textColor="#1B2631"
    android:textSize="40sp"
    android:autofillHints="" tools:targetApi="o" />

<Button
    android:id="@+id/b1"
    android:layout_width="76dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/et1"
    android:layout_alignParentLeft="true"
    android:layout_marginStart="15pt"
    android:layout_marginLeft="35dp"
    android:layout_marginTop="70dp"
    android:layout_marginEnd="15pt"
    android:layout_marginRight="15pt"
    android:layout_marginBottom="15pt"
    android:background="#283747"
    android:text="C"
    android:textColor="#bababa"
    android:textSize="15pt"
    tools:ignore="RtlHardcoded" />


<Button
    android:layout_width="76dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/et1"
    android:layout_alignRight="@+id/b1"
    android:layout_marginLeft="35dp"
    android:layout_marginTop="70dp"
    android:layout_marginRight="-94dp"
    android:background="#283747"
    android:text="+/-"
    android:textColor="#bababa"
    android:textSize="15pt"
    android:id="@+id/bt3"
    tools:ignore="RtlHardcoded"/>
<Button
    android:id="@+id/bt4"
    android:layout_width="76dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/et1"
    android:layout_alignEnd="@+id/bt2"
    android:layout_marginTop="66dp"
    android:background="#283747"
    android:text="+"
    android:textColor="#bababa"
    android:layout_marginRight="-95dp"
    android:textSize="15pt"
    tools:ignore="RtlHardcoded"/>

see sir i have send the code again above this is also showing same error and i have mentioned root tag. before it was’nt sent in correct way sorry for that in this it is not showing but i have closed the tag also

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
        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="#333333"
        android:textDirection="locale"
        android:transitionGroup="false"
        tools:context=".MainActivity"
        android:backgroundTint="#1B2631">

    <EditText
            android:id="@+id/et1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_marginTop="109dp"
            android:background="#bababa"
            android:cursorVisible="false"
            android:ems="10"
            android:inputType="number"
            android:text="0"
            android:textAlignment="textEnd"
            android:textColor="#1B2631"
            android:textSize="40sp"
            android:autofillHints="" tools:targetApi="o"/>

    <Button
            android:id="@+id/b1"
            android:layout_width="76dp"
            android:layout_height="wrap_content"
            android:layout_below="@+id/et1"
            android:layout_alignParentLeft="true"
            android:layout_marginStart="15pt"
            android:layout_marginLeft="35dp"
            android:layout_marginTop="70dp"
            android:layout_marginEnd="15pt"
            android:layout_marginRight="15pt"
            android:layout_marginBottom="15pt"
            android:background="#283747"
            android:text="C"
            android:textColor="#bababa"
            android:textSize="15pt"
            tools:ignore="RtlHardcoded"/>


    <Button
            android:layout_width="76dp"
            android:layout_height="wrap_content"
            android:layout_below="@+id/et1"
            android:layout_alignRight="@+id/b1"
            android:layout_marginLeft="35dp"
            android:layout_marginTop="70dp"
            android:layout_marginRight="-94dp"
            android:background="#283747"
            android:text="+/-"
            android:textColor="#bababa"
            android:textSize="15pt"
            android:id="@+id/bt3"
            tools:ignore="RtlHardcoded"/>
    <Button
            android:id="@+id/bt4"
            android:layout_width="76dp"
            android:layout_height="wrap_content"
            android:layout_below="@+id/et1"
            android:layout_alignEnd="@+id/bt3"
            android:layout_marginTop="66dp"
            android:background="#283747"
            android:text="+"
            android:textColor="#bababa"
            android:layout_marginRight="-95dp"
            android:textSize="15pt"
            tools:ignore="RtlHardcoded"/>
</RelativeLayout>

I have changed the your code to remove errors. Now it shouldn’t have any errors. Just copy and paste it in your xml.

sir can u tell me what were the errors

You diidn’t wrote the relative layout closing tag