title: Element LinearLayout is not allowed in CardView
body: <p>Note: <strong>PLEASE READ THE QUESTION</strong> before mark it as duplicate! I've mentioned that the similar question has not solved my problem.</p>
  
  <hr>
  
  <p>I am using <code>android.support.v7.widget.CardView</code> for my layout xml. However when I place a <code>LinearLayout</code> within the <code>CardView</code>, Android Studio gives me the following error "<strong><em>Element LinearLayout is not allowed here</em></strong>".</p>
  
  <p>In fact <strong>ANY</strong> types of widgets (like TextView) would cause this error, I have tried solutions from <a href="https://stackoverflow.com/questions/27440887/linearlayout-flagged-if-used-in-cardview">LinearLayout flagged if used in CardView </a> link, which was to restart Android Studio. But it did not work. Below is my xml code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;android.support.v7.widget.CardView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;LinearLayout&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p></p>
  
  <p>And I will also post a screenshot!</p>
  
  <p><a href="https://i.stack.imgur.com/36pev.png" rel="noreferrer"><img src="https://i.stack.imgur.com/36pev.png" alt="enter image description here"></a></p>
  
  <p>What could be the problem??</p>