I was running my app fine using Android Studio 3.0 Canary 4 but after updating to Canary 5 the app now crashes on start with:
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.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:474)
at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:328)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:289)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.bleachr.fan_engine.activities.BaseActivity.setContentView(BaseActivity.java:138)
I've narrowed it down to what I think is an issue loading the app styles..
the Exception mentions windowNoTitle: false when I'm setting this flag to true. Here's the relevant xml lines I can think of:
styles.xml:
<style name="AppTheme.Base" parent="Theme.AppCompat.Light">
<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="windowNoTitle">true</item>
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
</style>
<style name="AppTheme" parent="AppTheme.Base"/>
AndroidManifest.xml
<application
...
android:theme="@style/AppTheme"
I'm not overriding the theme for this Activity in any other way so that should be it..
My initial thought is somehow the windowNoTitle isn't being loaded - otherwise it'd be logged as true in the Exception. Does that make sense?
Any thoughts? I'm not sure if/how I can downgrade to Canary 4 again.. I'm sure I can use the stable build but I'd rather figure out this issue if possible.
Update: I removed android:theme="@style/AppTheme" from AndroidManifest and still getting the same Exception!
Note I've done the 'invalidate and restart' option in Android Studio as well as about everything else I've seen in other similar Stack Overflow posts.
Also - there's no v21/styles.xml or anything else that should be in the way here either in case you were wondering..