title: "You need to use a Theme.AppCompat theme (or descendant) with this activity" when using AppCompat theme
body: <p>I have a very strange problem with my app. After updating to the newest versions of Support libraries I get this error:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
  </code></pre>
  
  <p>This is where the exception is thrown:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
      …
      @Override
          protected void onCreate(Bundle savedInstanceState) {
          getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
          super.onCreate(savedInstanceState);//Exception thrown here
      }
  
      …
  
  }
  </code></pre>
  
  <p>What is strange is that I am using AppCompat theme with all my Activities:
  <strong>AndroidManifest.xml:</strong></p>
  
  <pre><code>&lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme"
          android:name="com.orm.SugarApp"&gt;
          &lt;activity
              android:name="com.example.app.MainActivity"
              android:label="@string/app_name"
              android:screenOrientation="portrait"
               &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
      …
  &lt;/application&gt;
  </code></pre>
  
  <p><strong>styles.xml:</strong></p>
  
  <pre><code>&lt;resources&gt;
  
      &lt;style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
  
          &lt;!--   your app branding color for the app bar --&gt;
          &lt;item name="colorPrimary"&gt;@color/primary&lt;/item&gt;
          &lt;!--   darker variant for the status bar and contextual app bars --&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/primary_dark&lt;/item&gt;
          &lt;!--   theme UI controls like checkboxes and text fields --&gt;
          &lt;item name="colorAccent"&gt;@color/accent&lt;/item&gt;
          &lt;item name="actionBarStyle"&gt;@style/MyActionBar&lt;/item&gt;
          &lt;item name="actionBarTabTextStyle"&gt;@style/MyActionBarTabText&lt;/item&gt;
          &lt;item name="windowActionBarOverlay"&gt;true&lt;/item&gt;
  
      &lt;/style&gt;
  
      &lt;style name="MyActionBar"
          parent="Widget.AppCompat.Light.ActionBar.Solid"&gt;
          &lt;item name="android:icon"&gt;@drawable/ic_launcher&lt;/item&gt;
          &lt;item name="icon"&gt;@drawable/ic_launcher&lt;/item&gt;
  
      &lt;/style&gt;
  
      &lt;style name="MyActionBarTabText" parent="Widget.AppCompat.ActionBar.TabText"&gt;
          &lt;item name="textAllCaps"&gt;false&lt;/item&gt;
          &lt;item name="android:textAllCaps"&gt;false&lt;/item&gt;
          &lt;item name="android:textSize"&gt;16sp&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;!-- Application theme. --&gt;
      &lt;style name="AppTheme" parent="AppBaseTheme"&gt;
      &lt;/style&gt;
  
      &lt;style name="menu_labels_style"&gt;
          &lt;item name="android:background"&gt;@drawable/fab_label_background&lt;/item&gt;
          &lt;item name="android:textColor"&gt;@color/white&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>Why is this exception thrown then? </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><strong>v21/styles.xml :</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;style name="AppTheme" parent="AppBaseTheme"&gt;
          &lt;!-- Main theme colors --&gt;
          &lt;!--   your app branding color for the app bar --&gt;
          &lt;item name="android:colorPrimary"&gt;@color/primary_lolipop&lt;/item&gt;
          &lt;!--   darker variant for the status bar and contextual app bars --&gt;
          &lt;item name="android:colorPrimaryDark"&gt;@color/primary_dark&lt;/item&gt;
          &lt;!--   theme UI controls like checkboxes and text fields --&gt;
          &lt;item name="android:colorAccent"&gt;@color/accent&lt;/item&gt;
          &lt;item name="android:actionBarStyle"&gt;@style/MyActionBar&lt;/item&gt;
          &lt;item name="android:colorButtonNormal"&gt;@color/accent&lt;/item&gt;
          &lt;item name="android:textColorAlertDialogListItem"&gt;@color/accent&lt;/item&gt;
  
          &lt;item name="android:navigationBarColor"&gt;@color/navbar&lt;/item&gt;
          &lt;item name="android:actionBarTabTextStyle"&gt;@style/MyActionBarTabText&lt;/item&gt;
          &lt;item name="android:windowActionBarOverlay"&gt;true&lt;/item&gt;
  
          &lt;item name="android:windowContentTransitions"&gt;true&lt;/item&gt;
          &lt;item name="android:windowAllowEnterTransitionOverlap"&gt;true&lt;/item&gt;
          &lt;item name="android:windowAllowReturnTransitionOverlap"&gt;true&lt;/item&gt;
          &lt;item name="android:windowSharedElementEnterTransition"&gt;@android:transition/move&lt;/item&gt;
          &lt;item name="android:windowSharedElementExitTransition"&gt;@android:transition/move&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>