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 windowNoTitle
as 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
Context.Startforegroundservice() Did Not Then Call Service.Startforeground()
Cursorloader Usage Without Contentprovider
Android: How to Have Viewpager Wrap_Content
How to Refresh Mediastore on Android
Check Android Application Is in Foreground or Not
Where Is Debug.Keystore in Android Studio
Solution to Install_Failed_Insufficient_Storage Error on Android
How to Use Custom Font in a Project Written in Android Studio
Android Pick Images from Gallery
How to Resume Existing Fragment from Backstack
How to Force Use of Overflow Menu on Devices With Menu Button
How to Change the Background Color of Action Bar'S Option Menu in Android 4.2
Android - How to Disable the Click of Home Button
Android Studio Marks R in Red with Error Message "Cannot Resolve Symbol R", But Build Succeeds