Exception raised during rendering: Binary XML file line #-1: Error inflating class
<p>I just add a timepicker in my layout. It works fine if the TimePickerMode is clock, but when I change it to spinner, it shows this error: <code>Exception raised during rendering: Binary XML file line #-1: Error inflating class</code></p>

<p>Here is my XML file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.willlian.apolloyios.SetupTime"
    android:background="#ffffff"&gt;

    &lt;TimePicker
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/timePicker"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="92dp"
        android:background="#ffffff"
        android:timePickerMode="spinner" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>