Missing AppCompat theme features

NekromancerNekromancer PLMember
edited April 2015 in Xamarin.Android

After updating AppCompat library to 22.1 version i got following exception on one of my activies. Error:

  Java.Lang.IllegalArgumentException: AppCompat does not support the current theme features
      at at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00047>
      at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) [0x00084] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:896
      at Android.App.Activity.SetContentView (int) [0x00070] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:4763
      at AplikacjaParlamentAndroid.PeopleActivity.OnCreate (Android.OS.Bundle) [0x00007] in /Users/mac/XamarinProjects/AplikacjaParlament/AplikacjaParlamentAndroid/Activities/PeopleActivity.cs:50
      at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:2380
      at at (wrapper dynamic-method) object.dde9cc1f-a6ae-4f9a-8f19-8f060d9402b4 (intptr,intptr,intptr) <IL 0x00017, 0x0001f>
      at --- End of managed exception stack trace ---
      at java.lang.IllegalArgumentException: AppCompat does not support the current theme features
      at at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:360)
      at at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:246)
      at at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
      at at aplikacjaparlamentandroid.PeopleActivity.n_onCreate(Native Method)
      at at aplikacjaparlamentandroid.PeopleActivity.onCreate(PeopleActivity.java:28)
      at at android.app.Activity.performCreate(Activity.java:5231)
      at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
      at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
      at at android.app.ActivityThread.access$800(ActivityThread.java:135)
      at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
      at at android.os.Handler.dispatchMessage(Handler.java:102)
      at at android.os.Looper.loop(Looper.java:136)
      at at android.app.ActivityThread.main(ActivityThread.java:5017)
      at at java.lang.reflect.Method.invokeNative(Native Method)
      at at java.lang.reflect.Method.invoke(Method.java:515)
      at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
      at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
      at at dalvik.system.NativeStart.main(Native Method)

Activity xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:background="@drawable/bg"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <include
        layout="@layout/toolbar" />
    <android.support.v4.widget.DrawerLayout
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <pagerslidingtabstrip.PagerSlidingTabStrip
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="38dip"
                android:textColor="#FFFFFF"
                app:shouldExpand="true"
                app:indicatorColor="#FFFFFF"
                app:indicatorHeight="1dp" />
            <android.support.v4.view.ViewPager
                android:id="@+id/pager"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/tabs" />
        </RelativeLayout>
        <ListView
            android:id="@+id/left_drawer"
            android:layout_width="240dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:choiceMode="singleChoice"
            android:divider="#B2B2B2"
            android:dividerHeight="1dp"
            android:background="#790205" />
    </android.support.v4.widget.DrawerLayout>
</LinearLayout>

And my theme:

<?xml version="1.0" encoding="UTF-8" ?>
<resources>
    <style name="Theme.MyTheme" parent="Theme.AppCompat.NoActionBar">
      <item name="windowNoTitle">true</item>
      <item name="windowActionBar">false</item>

      <item name="colorPrimary">#E00006</item>
      <item name="colorPrimaryDark">#790205</item>
      <item name="android:textColorPrimary">#FFFFFF</item>
    </style>
</resources>

Any idea what might be the couse?``````

Answers

Sign In or Register to comment.