2017-08-11 1 views
1

Meine App fein auf Android N laufen, aber es ist bei setContentView(R.layout.activity_main) auf Android M Absturz:AppCompat nicht das aktuelle Thema unterstützt

Caused by: java.lang.IllegalArgumentException: AppCompat does not support the current theme features: { windowActionBar: false, windowActionBarOverlay: false, android:windowIsFloating: false, windowActionModeOverlay: true, windowNoTitle: false } 

Was seltsam ist, dass ich nicht einmal etwas mit dem zu tun bearbeiten meine App Thema, und so dieser Fehler ist sehr seltsam:

styles.xml:

<resources> 

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

    <style name="DialogStyle"> 
     <item name="android:windowFrame">@null</item> 
     <item name="android:windowIsFloating">true</item> 
     <item name="android:windowContentOverlay">@null</item> 
     <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> 
     <item name="android:windowBackground">@color/textColorPrimary</item> 
     <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> 
     <item name="android:colorBackgroundCacheHint">@null</item> 
     <item name="android:textColorPrimary">@color/black</item> 
    </style> 

</resources> 

Schwerwiegende Ausnahme: main Prozess: com.curlybraceapps.ruchir.rescuer, PID: 20394 java.lang.RuntimeException: Kann nicht Aktivität ComponentInfo {com.curlybraceapps.ruchir.rescuer/com.curlybraceapps.ruchir.rescuer.MainActivity starten }: java.lang.IllegalArgumentException: AppCompat unterstützt nicht die aktuellen Thema Features: {windowActionBar: false, windowActionBarOverlay: false, android: windowIsFloating: false, windowActionModeOverlay: true, windowNoTitle: false} bei android.app .ActivityThread.performLaunchActivity (ActivityThread.java:2325) unter andr oid.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2387) bei android.app.ActivityThread.access $ 800 (ActivityThread.java:151) bei android.app.ActivityThread $ H.handleMessage (ActivityThread.java:1303) bei android.os.Handler.dispatchMessage (Handler.java:102) bei android.os.Looper.loop (Looper.java:135) bei android.app.ActivityThread.main (ActivityThread.java:5254) bei java.lang.reflect.Method.invoke (Native Methode) bei java.lang.reflect.Method.invoke (Method.java:372) um com.android.internal.os.ZygoteI Nit $ MethodAndArgsCaller.run (ZygoteInit.java:903) bei com.android.internal.os.ZygoteInit.main (ZygoteInit.java:698) Verursacht durch: java.lang.IllegalArgumentException: AppCompat nicht Unterstützung der aktuellen Thema Features: {windowActionBar: false, windowActionBarOverlay: false, android: windowIsFloating: false, windowActionModeOverlay: true, windowNoTitle: false} bei android.support.v7.app.AppCompatDelegateImplV9.createSubDecor (AppCompatDelegateImplV9.java:474) unter android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor (AppCompatDelegateImplV9.java:328) bei android.support.v7.app.AppCompatDelegateImplV9.setContentView (AppCompatDelegateImplV9.java:289) bei android.support.v7.app.AppCompatActivity.setContentView (AppCompatActivity.java:140) bei com.curlybraceapps.ruchir .rescuer.MainActivity.onCreate (MainActivity.java:152) bei android.app.Activity.performCreate (Activity.java:6033) bei android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1106) bei android .app.ActivityThread.performLaunchActivity (ActivityThread.java: 2278) bei android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2387) bei android.app.ActivityThread.access $ 800 (ActivityThread.java:151) bei android.app.ActivityThread $ H.handleMessage (ActivityThread.java:1303) bei android.os.Handler.dispatchMessage (Handler.java:102) bei android.os.Looper.loop (Looper.java:135) bei android.app.ActivityThread.main (ActivityThread .java: 5254) bei java.lang.reflect.Method.invoke (native Methode) bei java.lang.reflect.Method.invoke (Method.java:372) bei com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:903) bei com.android.internal.os.ZygoteInit.main (ZygoteInit.java:698)

Warum Tritt dieses Problem plötzlich auf, obwohl ich an meinem Thema überhaupt nichts geändert habe?

Antwort

0

Zwei Optionen.

Eins, versuchen Sie, das Projekt sauber und neu zu erstellen.

Zwei, die Definitionen, wie dies ändern, ohne „Android“:

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

<item name="windowNoTitle">true</item> 
+0

Keine Ihrer Optionen war effektiv. –

0

Immer gleiches Problem, damit ich meinen Stil wie diese aktualisieren und seine gearbeitet.

<style name="AppTheme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light"> 
    <item name="windowNoTitle">true</item> 
    <item name="windowActionBar">false</item> 
    <item name="android:windowFullscreen">true</item> 
    <item name="android:windowContentOverlay">@null</item> 
</style> 
Verwandte Themen