title: Element type "Button" must be followed by either attribute specifications, ">" or "/>"
body: <p>I am creating a button in my XML and here is the creation parameters</p>
  
  <pre><code>&lt;Button android:id="@+id/btn2"
    ---&gt;  android:layout_width="wrap_content"  &lt;----
      android:layout_height="wrap_content"
      android:text="@string/PNR"
  /&gt;
  </code></pre>
  
  <p>I am getting and error in the line indicated saying : </p>
  
  <p>" Element type "Button" must be followed by either attribute specifications, ">" or "/>" "</p>
  
  <p>Not only in button id I try to create TextView or so then also same error comes and at same place.</p>
  
  <p>I have checked earlier posts but they said that the tags were not closed and did not worked for me.</p>
  
  <p>Please suggest me, what to do? Here is the full code :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
  &lt;Button android:id="@+id/btn2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/PNR"
      /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>