Android-AppCompat不支持当前主题功能错误 [英] Android - AppCompat does not support the current theme features Error

查看:280
本文介绍了Android-AppCompat不支持当前主题功能错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在删除一些布局文件和活动之前,我的应用程序运行良好.从那以后,它显示此错误:

My app was working fine until I deleted few layout files and activities. Since then its showing this error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.skaprer.jope/com.skaprer.jope.Controllers.LoaderActivity}: java.lang.IllegalArgumentException: AppCompat does not support the current theme features: { windowActionBar: false, windowActionBarOverlay: false, android:windowIsFloating: false, windowActionModeOverlay: false, windowNoTitle: false }
                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                at android.os.Looper.loop(Looper.java:148)
                                                                at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                             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.createSubDecor(AppCompatDelegateImplV7.java:422)
                                                                at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:279)
                                                                at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:253)
                                                                at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
                                                                at com.skaprer.jope.Controllers.LoaderActivity.onCreate(LoaderActivity.java:39)
                                                                at android.app.Activity.performCreate(Activity.java:6251)
                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                at android.os.Looper.loop(Looper.java:148) 
                                                                at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                at java.lang.reflect.Method.invoke(Native Method) 
                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

我的LoaderActivity文件出现错误:

My LoaderActivity file where error occurs :

 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
    Fabric.with(this, new Crashlytics(), new TwitterCore(authConfig), new Digits());
    setContentView(R.layout.activity_loader);
}

主题文件:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/primary_color</item>
    <item name="colorPrimaryDark">@color/primary_dark_color</item>
    <item name="colorAccent">@color/accent_color</item>
</style>

v21:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/primary_color</item>
    <item name="colorPrimaryDark">@color/primary_dark_color</item>
    <item name="colorAccent">@color/accent_color</item>
    <item name="android:navigationBarColor">#212121</item>
    <item name="android:windowContentTransitions">true</item>
</style>

自更改以来,该应用程序无法启动.我尝试更改意图过滤器以启动不同的活动,以检查该错误是否特定于该活动,但是我尝试的每个活动都仍然存在该错误.我该怎么办?

Ever since the change, the app fails to start. I tried changing the intent filter to start different activities to check if the error is particular for the activity but with every activity i tried, the error remains. What should I do?

推荐答案

由于最近的Android Studio 2.0更新,这是一个错误,IDE仅针对更改的部分重建应用程序,而不是重建整个内容.因此,我只是清理并重建它,从设备上卸载该应用程序,然后运行它.奏效了.

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.

这篇关于Android-AppCompat不支持当前主题功能错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆