title: UnsupportedOperationException: Can't convert to dimension: type=0x1
body: <p>In Android I got following <strong>Error in the emulator and some mobile device</strong> but not in <strong>Tablet</strong>:</p>
  
  <p>I can't understand what is the error actually?</p>
  
  <p>I have searched many tutorials but can't find any solution.</p>
  
  <p>Please help me to solve this.</p>
  
  <p>Note: In this application, I have used <a href="http://actionbarsherlock.com" rel="noreferrer">ActionbarSherlock</a> and theme, may i got because of that library or any other problem?</p>
  
  <p><strong>My Error Log is:</strong></p>
  
  <pre><code>09-11 17:52:57.342: E/AndroidRuntime(9935): FATAL EXCEPTION: main
  09-11 17:52:57.342: E/AndroidRuntime(9935): android.view.InflateException: Binary XML file line #2: Error inflating class &lt;unknown&gt;
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.LayoutInflater.createView(LayoutInflater.java:613)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:371)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.AbsSpinner.onMeasure(AbsSpinner.java:193)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.Spinner.onMeasure(Spinner.java:439)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.View.measure(View.java:15518)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:681)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.View.measure(View.java:15518)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1217)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.ScrollView.onMeasure(ScrollView.java:321)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.View.measure(View.java:15518)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.View.measure(View.java:15518)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.View.measure(View.java:15518)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2176)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.View.measure(View.java:15518)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.Choreographer.doCallbacks(Choreographer.java:562)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.Choreographer.doFrame(Choreographer.java:532)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.os.Handler.handleCallback(Handler.java:725)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.os.Handler.dispatchMessage(Handler.java:92)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.os.Looper.loop(Looper.java:137)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.app.ActivityThread.main(ActivityThread.java:5041)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at java.lang.reflect.Method.invokeNative(Native Method)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at java.lang.reflect.Method.invoke(Method.java:511)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at dalvik.system.NativeStart.main(Native Method)
  09-11 17:52:57.342: E/AndroidRuntime(9935): Caused by: java.lang.reflect.InvocationTargetException
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at java.lang.reflect.Constructor.constructNative(Native Method)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.view.LayoutInflater.createView(LayoutInflater.java:587)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     ... 45 more
  09-11 17:52:57.342: E/AndroidRuntime(9935): Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.TextView.&lt;init&gt;(TextView.java:916)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     at android.widget.TextView.&lt;init&gt;(TextView.java:578)
  09-11 17:52:57.342: E/AndroidRuntime(9935):     ... 48 more
  </code></pre>
  
  <p><strong>My XML Layout file is:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:panel="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginBottom="@dimen/activity_vertical_margin"
          android:layout_marginLeft="@dimen/other_activity_horizontal_margin"
          android:layout_marginRight="@dimen/other_activity_horizontal_margin"
          android:layout_marginTop="@dimen/activity_vertical_margin"
          android:orientation="vertical" &gt;
  
          &lt;EditText
              android:id="@+id/custDetailsNameEditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_centerHorizontal="true"
              android:hint="@string/name_cust_all_add"
              android:inputType="textPersonName"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsEmailEditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsNameEditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/email_cust_all_add"
              android:inputType="textEmailAddress"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;Spinner
              android:id="@+id/custDetailsDistributorSpinner"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsEmailEditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:entries="@array/slide_menu_items"
              android:prompt="@string/select_distributor_prompt_add"
              android:spinnerMode="dialog" &gt;
          &lt;/Spinner&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsAddress1TitleEditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsDistributorSpinner"
              android:layout_marginTop="15dp"
              android:hint="@string/address_1_cust_all_add"
              android:inputType="textPostalAddress"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsAddress2TitleEditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsAddress1TitleEditText"
              android:layout_marginTop="15dp"
              android:hint="@string/address_2_cust_all_add"
              android:inputType="textPostalAddress"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsAddress3TitleEditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsAddress2TitleEditText"
              android:layout_marginTop="15dp"
              android:hint="@string/address_3_cust_all_add"
              android:inputType="textPostalAddress"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;Spinner
              android:id="@+id/custDetailsCompanyAreaSpinner"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsAddress3TitleEditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:entries="@array/slide_menu_items"
              android:prompt="@string/select_company_area_prompt_add"
              android:spinnerMode="dialog" 
              android:fastScrollEnabled="true"
              &gt;
          &lt;/Spinner&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsPincodeEditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsCompanyAreaSpinner"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/pincode_cust_all_add"
              android:inputType="number"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsPhone1EditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsPincodeEditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/phone_1_cust_all_add"
              android:inputType="phone"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsPhone2EditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsPhone1EditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/phone_2_cust_all_add"
              android:inputType="phone"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsMobileNo1EditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsPhone2EditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/mobile_no_1_cust_all_add"
              android:inputType="phone"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsMobileNo2EditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsMobileNo1EditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/mobile_no_2_cust_all_add"
              android:inputType="phone"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsContactPerson1EditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsMobileNo2EditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/contact_person_1_cust_all_add"
              android:inputType="text"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsContactPerson2EditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsContactPerson1EditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/contact_person_2_cust_all_add"
              android:inputType="text"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsTinNoEditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsContactPerson2EditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/tin_no_cust_all_add"
              android:inputType="text"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;EditText
              android:id="@+id/custDetailsCstNoEditText"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsTinNoEditText"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="15dp"
              android:hint="@string/cst_no_cust_all_add"
              android:inputType="text"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;RadioGroup
              android:id="@+id/custDetailsVTVRRadioGroup"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsCstNoEditText"
              android:layout_marginTop="15dp"
              android:orientation="horizontal" &gt;
  
              &lt;TextView
                  android:id="@+id/custDetailsVTVRLableTextView"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/vt_vr_cust_all_add"
                  android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
              &lt;RadioButton
                  android:id="@+id/custDetailsVTRadioButton"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:checked="true"
                  android:text="@string/vt_cust_all_add" /&gt;
  
              &lt;RadioButton
                  android:id="@+id/custDetailsVRRadioButton"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/vr_cust_all_add" /&gt;
          &lt;/RadioGroup&gt;
  
          &lt;RadioGroup
              android:id="@+id/custDetailsCFormRadioGroup"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/custDetailsVTVRRadioGroup"
              android:layout_marginTop="15dp"
              android:orientation="horizontal" &gt;
  
              &lt;TextView
                  android:id="@+id/custDetailsCFormLableTextView"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/c_form_cust_add_all"
                  android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
              &lt;RadioButton
                  android:id="@+id/custDetailsCFormYesRadioButton"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:checked="true"
                  android:text="@string/yes_cust_add_all" /&gt;
  
              &lt;RadioButton
                  android:id="@+id/custDetailsCFormNoRadioButton"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/no_cust_add_all" /&gt;
          &lt;/RadioGroup&gt;
      &lt;/RelativeLayout&gt;
  
  &lt;/ScrollView&gt;
  </code></pre>
  
  <h3><code>styles.xml</code> in <code>values</code> folder:</h3>
  
  <pre><code>&lt;resources xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;!--
          Base application theme, dependent on API level. This theme is replaced
          by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
      --&gt;
      &lt;style name="AppBaseTheme" parent="android:Theme.Light"&gt;
          &lt;!--
              Theme customizations available in newer API levels can go in
              res/values-vXX/styles.xml, while customizations related to
              backward-compatibility can go here.
          --&gt;
      &lt;/style&gt;
  
      &lt;style name="SlideBarTheme" parent="@style/Theme.Sherlock.NoActionBar"&gt;
          &lt;item name="android:background"&gt;@drawable/slide_bg&lt;/item&gt;
          &lt;item name="android:cacheColorHint"&gt;@android:color/transparent&lt;/item&gt;
          &lt;item name="android:choiceMode"&gt;singleChoice&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="ActivityTheme" parent="@style/Theme.Sherlock.Light"&gt;
          &lt;item name="android:textColor"&gt;@color/activity_text&lt;/item&gt;
          &lt;item name="android:background"&gt;@color/activity_background&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;!-- For Widget --&gt;
  
      &lt;style name="MyAndroidTheme" parent="@style/Theme.Sherlock.Light.DarkActionBar"&gt;
          &lt;item name="android:editTextStyle"&gt;@style/EditTextAppTheme&lt;/item&gt;
          &lt;item name="android:autoCompleteTextViewStyle"&gt;@style/AutoCompleteTextViewAppTheme&lt;/item&gt;
          &lt;item name="android:checkboxStyle"&gt;@style/CheckBoxAppTheme&lt;/item&gt;
          &lt;item name="android:spinnerStyle"&gt;@style/SpinnerAppTheme&lt;/item&gt;
          &lt;item name="android:dropDownSpinnerStyle"&gt;@style/SpinnerAppTheme.DropDown&lt;/item&gt;
          &lt;item name="android:spinnerDropDownItemStyle"&gt;@style/SpinnerDropDownItemAppTheme&lt;/item&gt;
          &lt;item name="android:listViewStyle"&gt;@style/ListViewAppTheme&lt;/item&gt;
          &lt;item name="android:listViewWhiteStyle"&gt;@style/ListViewAppTheme.White&lt;/item&gt;
          &lt;item name="android:spinnerItemStyle"&gt;@style/SpinnerItemAppTheme&lt;/item&gt;
      &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <h3><code>styles.xml</code> in <code>values-11</code> folder:</h3>
  
  <pre><code>    &lt;resources&gt;
  
      &lt;!--
          Base application theme for API 11+. This theme completely replaces
          AppBaseTheme from res/values/styles.xml on API 11+ devices.
      --&gt;
  
      &lt;!-- API 11 theme customizations can go here. --&gt;
      &lt;style name="MyAndroidTheme" parent="android:Theme.Holo.Light.DarkActionBar"&gt;
          &lt;item name="android:editTextBackground"&gt;@drawable/edit_text_holo_light&lt;/item&gt;
          &lt;item name="android:autoCompleteTextViewStyle"&gt;@style/AutoCompleteTextViewAppTheme&lt;/item&gt;
          &lt;item name="android:listChoiceIndicatorMultiple"&gt;@drawable/btn_check_holo_light&lt;/item&gt;
          &lt;item name="android:dropDownSpinnerStyle"&gt;@style/SpinnerAppTheme&lt;/item&gt;
          &lt;item name="android:listChoiceBackgroundIndicator"&gt;@drawable/list_selector_holo_light&lt;/item&gt;
          &lt;item name="android:activatedBackgroundIndicator"&gt;@drawable/activated_background_holo_light&lt;/item&gt;
      &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <h3><code>styles.xml</code> in <code>values-14</code> folder:</h3>
  
  <pre><code>&lt;resources&gt;
  
      &lt;!--
          Base application theme for API 14+. This theme completely replaces
          AppBaseTheme from BOTH res/values/styles.xml and
          res/values-v11/styles.xml on API 14+ devices.
      --&gt;
      &lt;style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"&gt;
          &lt;!-- API 14 theme customizations can go here. --&gt;
      &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>And also I have a custom theme file:</p>
  
  <p>In <code>values</code> folder named <code>styles_apptheme.xml</code> and <code>styles_myactionbar.xml</code>,
  In <code>values-v11</code> folder named <code>styles_apptheme.xml</code>,
  In <code>values-v14</code> folder named <code>styles_myactionbar.xml</code></p>
  
  <p>What should I change?</p>