title: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12
body: <p>So my problem is a weird one. I keep getting this error:</p>
  
  <pre><code>java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12
  </code></pre>
  
  <p>The weird part is that it only happens on 4.1.2. I've tested 4.0.3, 4.2.2, 4.3 and 4.4. All work perfectly except 4.1.2. Since 4.0.3 works, 4.1.2 technically should too so I just can't figure out what's wrong.</p>
  
  <p>Here's my activity_main.xml:</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:fitsSystemWindows="true"
  tools:context="-removed name-"&gt;
  
  
  &lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;!-- FrameLayout to display Fragments --&gt;
      &lt;FrameLayout
          android:id="@+id/frame_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
      &lt;!-- ListView to display slider menu --&gt;
      &lt;ListView
          android:id="@+id/list_slidermenu"
          android:layout_width="240dp"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:choiceMode="singleChoice"
          android:divider="@color/list_divider"
          android:dividerHeight="1dp"
          android:listSelector="@drawable/list_selector"
          android:background="@color/list_background" /&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>And here's my fragment_layout.xml:</p>
  
  <pre><code> &lt;RelativeLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"&gt;
  
   &lt;Spinner
   android:layout_width="match_parent"
   android:layout_height="48dp"
   android:id="@+id/spinner_convertFrom"
   android:spinnerMode="dialog"
   android:layout_marginLeft="16dp"
   android:layout_marginRight="4dp"
   android:layout_alignRight="@+id/button"
   android:layout_alignTop="@+id/spinner_convertTo" /&gt;
  
  &lt;Spinner
  android:layout_width="match_parent"
  android:layout_height="48dp"
  android:id="@+id/spinner_convertTo"
  android:spinnerMode="dialog"
  android:layout_marginRight="16dp"
  android:layout_marginLeft="4dp"
  android:layout_alignLeft="@+id/button"
  android:layout_marginTop="90dp" /&gt;
  
  &lt;EditText
  android:layout_width="wrap_content"
  android:layout_height="48dp"
  android:inputType="numberDecimal|numberSigned"
  android:ems="10"
  android:id="@+id/editText_convert"
  android:gravity="center"
  android:imeOptions="actionDone"
  android:selectAllOnFocus="true"
  android:layout_marginBottom="30dp"
  android:layout_above="@+id/button_Convert"
  android:layout_centerHorizontal="true" /&gt;
  
  &lt;Button
  android:layout_width="wrap_content"
  android:layout_height="48dp"
  android:text="@string/convert_button"
  android:id="@+id/button_Convert"
  android:clickable="true"
  android:gravity="center"
  android:layout_marginBottom="40dp"
  android:layout_above="@+id/textView_result"
  android:layout_centerHorizontal="true"/&gt;
  
  &lt;TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textAppearance="?android:attr/textAppearanceSmall"
  android:text="@string/convert_from"
  android:id="@+id/textView_convertFrom"
  android:textSize="14sp"
  android:layout_alignLeft="@+id/spinner_convertFrom"
  android:layout_marginBottom="8dp"
  android:layout_alignTop="@+id/textView_ConvertTo" /&gt;
  
  &lt;TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textAppearance="?android:attr/textAppearanceSmall"
  android:text="@string/convert_to"
  android:id="@+id/textView_ConvertTo"
  android:textSize="14sp"
  android:layout_alignLeft="@+id/spinner_convertTo"
  android:layout_marginTop="74dp" /&gt;
  
  &lt;TextView
  android:layout_width="wrap_content"
  android:layout_height="120dp"
  android:text="@string/result_box"
  android:id="@+id/textView_result"
  android:layout_alignParentRight="true"
  android:layout_alignParentBottom="true"
  android:layout_alignParentLeft="true"
  android:layout_marginBottom="16dp"
  android:layout_marginLeft="16dp"
  android:layout_marginRight="16dp"
  android:gravity="center"
  android:singleLine="false"
  android:textIsSelectable="true"
  android:background="@drawable/result_border" /&gt;
  
  &lt;Button
  style="?android:attr/buttonStyleSmall"
  android:layout_width="0dp"
  android:layout_height="0dp"
  android:id="@+id/button"
  android:layout_centerHorizontal="true" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I've searched through all the similar questions but their solutions won't work for me.</p>
  
  <p>Full log: </p>
  
  <pre><code> java.lang.RuntimeException: Unable to start activity ComponentInfo{-removed name-/-removed name-.MainActivity}: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
          at android.app.ActivityThread.access$600(ActivityThread.java:130)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:137)
          at android.app.ActivityThread.main(ActivityThread.java:4745)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
          at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12
          at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
          at android.view.ViewGroup$MarginLayoutParams.&lt;init&gt;(ViewGroup.java:5616)
          at android.widget.LinearLayout$LayoutParams.&lt;init&gt;(LinearLayout.java:1809)
          at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1721)
          at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:58)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:748)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
          at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2784)
          at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2844)
          at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:252)
          at android.app.Activity.setContentView(Activity.java:1867)
          at -removed name-.MainActivity.onCreate(MainActivity.java:41)
          at android.app.Activity.performCreate(Activity.java:5008)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
  </code></pre>
  
  <p>The entire logcat didn't post. Here's the rest:</p>
  
  <pre><code>at android.app.ActivityThread.access$600(ActivityThread.java:130)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:137)
  at android.app.ActivityThread.main(ActivityThread.java:4745)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:511)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Styles.xml:</p>
  
  <pre><code>&lt;resources xmlns:tools="http://schemas.android.com/tools"&gt;
  
  &lt;style name="AppTheme" parent="@android:style/Theme.Holo"&gt;
      &lt;item name="android:popupMenuStyle"&gt;@style/PopupMenu.Konvertr&lt;/item&gt;
      &lt;item name="android:actionBarStyle"&gt;@style/ActionBar.Solid.Konvertr&lt;/item&gt;
      &lt;item name="android:windowBackground"&gt;@color/window_bg&lt;/item&gt;
      &lt;item name="android:windowTranslucentNavigation" tools:targetApi="19"&gt;true&lt;/item&gt;
      &lt;item name="android:dropDownSpinnerStyle"&gt;@style/SpinnerAppTheme&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="ActionBar.Solid.Konvertr" parent="@android:style/Widget.Holo.ActionBar.Solid"&gt;
      &lt;item name="android:background"&gt;@drawable/ab_background_textured_konvertr&lt;/item&gt;
      &lt;item name="android:backgroundStacked"&gt;@drawable/ab_stacked_solid_konvertr&lt;/item&gt;
      &lt;item name="android:backgroundSplit"&gt;@drawable/ab_background_textured_konvertr&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="ActionBar.Transparent.Konvertr" parent="@android:style/Widget.Holo.ActionBar"&gt;
      &lt;item name="android:background"&gt;@drawable/ab_transparent_konvertr&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="PopupMenu.Konvertr" parent="@android:style/Widget.Holo.ListPopupWindow"&gt;
      &lt;item name="android:popupBackground"&gt;@drawable/menu_dropdown_panel_konvertr&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="SpinnerAppTheme" parent="@android:Widget.Holo.Spinner"&gt;
      &lt;item name="android:background"&gt;@drawable/apptheme_spinner_background_holo_dark&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p></p>