Upgraded to Appcompat V22.1.0 and Now Getting Illegalargumentexception: Appcompat Does Not Support the Current Theme Features

Upgraded to AppCompat v22.1.0 and now getting IllegalArgumentException: AppCompat does not support the current theme features

AppCompat is now more strict on what it expect in theme window flags, more closely matching what you would get from the framework.

The main reason behind this is to support AppCompatDialogs which we were also adding in this release. They make heavy use of the windowNoTitle flag, which AppCompat previously didn't pay much attention to.

So to fix your issue you have two options:

The easy way is to just use Theme.AppCompat.NoActionBar as your parent theme. This will always do the right thing.

If you can't do that though (maybe you need to support action bar and no action bar), you should do the following:

<style name="MyTheme" parent="Theme.AppCompat">
...
</style>

<style name="MyTheme.NoActionBar">
<!-- Both of these are needed -->
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

You should be back on track now.

java.lang.IllegalArgumentException: AppCompat does not support the current theme features

alternative to @sbaar's answer,

keep windowActionBar to false and add windowNoTitleas well and set it to true.

ie

   <item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>

Android - AppCompat does not support the current theme features Error

It was an error because of the recent Android Studio 2.0 update, the IDE rebuilds the app for only the changed parts rather than rebuilding the whole thing. So I just clean and rebuild it, uninstalled the app from device and then run it. It worked.

AppCompat does not support the current theme features - nothing works

To anyone else having this problem, I just found the problem:
Apparently there exists another theme with name "AppTheme". I don't know why and how, but changing my theme's name solved the problem.

This was the answer to my problem.

Why AppCompat does not support the current theme features windowActionBar: false

Try this,

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>

<item name="windowActionBar">false</item>
<item name="windowActionBarOverlay">false</item>
<item name="windowIsFloating">false</item>
<item name="windowActionModeOverlay">false</item>
<item name="windowNoTitle">false</item>
</style>


Related Topics



Leave a reply



Submit