AppCompat does not support the current theme features – nothing works

Issue

I’m trying to use MaterialDesign in my project but I’m getting this error all the time:

Caused by: java.lang.IllegalArgumentException: AppCompat does not support the current theme features: { windowActionBar: false, windowActionBarOverlay: false, android:windowIsFloating: false, windowActionModeOverlay: false, windowNoTitle: false }
        at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:371)
        at android.support.v7.app.AppCompatDelegateImplV7.initWindowDecorActionBar(AppCompatDelegateImplV7.java:173)
        at android.support.v7.app.AppCompatDelegateImplBase.getSupportActionBar(AppCompatDelegateImplBase.java:87)
        at android.support.v7.app.AppCompatDelegateImplV7.setSupportActionBar(AppCompatDelegateImplV7.java:197)
        at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:99)
        at de.memorian.playpal.MainActivity.afterInject(MainActivity.java:72)

I’ve reade through similar problems but everytime I’m getting the same error.

MainActivity.java:

@EActivity(R.layout.activity_main)
public class MainActivity extends AppCompatActivity {

@ViewById
protected Toolbar toolbar;

@AfterInject
public void afterInject() {
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
}
}

styles.xml:

<style name="AppTheme" parent="AppTheme.Base"/>

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

styles-v21.xml:

style name="AppTheme" parent="AppTheme.Base">
    <!-- enable window content transitions -->
    <item name="android:windowContentTransitions">true</item>
    <item name="android:windowAllowEnterTransitionOverlap">true</item>
    <item name="android:windowAllowReturnTransitionOverlap">true</item>
    <!-- specify shared element transitions -->
    <item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
    <item name="android:windowSharedElementExitTransition">@android:transition/move</item>
</style>

I’ve tried setting parent theme to any derivation of .NoActionBar, but still. I’ve also tried removing all code from AndroidAnnotations and doing it the regular way with setContentView and findViewById(R.id.toolbar). Only thing that bothers me is that I set windowNoTitle to true but in the log it says it is false.

Any help?

Solution

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.

Answered By – Syex

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published