title: Adding a resources xml file to the project leads to runtime exception
body: <p>I want to include a resources xml file to my Android application project to hold some string values intended to have a specific purpose, named <code>categories_names.xml</code>, copying it into the <code>res/values</code> folder, but as soon as I try to run the application it exits throwing an <code>InflateException</code>. Strange thing is, this resources file is not even accessed from within the launcher activity. How is it possible? I report the backtrace below.</p>
  
  <pre><code>07-13 13:24:21.842: W/dalvikvm(27215): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
  07-13 13:24:21.872: E/AndroidRuntime(27215): FATAL EXCEPTION: main
  07-13 13:24:21.872: E/AndroidRuntime(27215): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mikidep.amount/com.mikidep.amount.MainActivity}: android.view.InflateException: Binary XML file line #53: Error inflating class android.widget.Button
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.os.Handler.dispatchMessage(Handler.java:99)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.os.Looper.loop(Looper.java:137)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.ActivityThread.main(ActivityThread.java:5041)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at java.lang.reflect.Method.invokeNative(Native Method)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at java.lang.reflect.Method.invoke(Method.java:511)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at dalvik.system.NativeStart.main(Native Method)
  07-13 13:24:21.872: E/AndroidRuntime(27215): Caused by: android.view.InflateException: Binary XML file line #53: Error inflating class android.widget.Button
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.createView(LayoutInflater.java:613)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at com.mikidep.amount.NumberFragment.onCreateView(NumberFragment.java:36)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.Fragment.performCreateView(Fragment.java:1695)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:861)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1035)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1137)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.Activity.onCreateView(Activity.java:4717)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.Activity.setContentView(Activity.java:1881)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at com.mikidep.amount.MainActivity.onCreate(MainActivity.java:29)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.Activity.performCreate(Activity.java:5104)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    ... 11 more
  07-13 13:24:21.872: E/AndroidRuntime(27215): Caused by: java.lang.reflect.InvocationTargetException
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at java.lang.reflect.Constructor.constructNative(Native Method)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.view.LayoutInflater.createView(LayoutInflater.java:587)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    ... 34 more
  07-13 13:24:21.872: E/AndroidRuntime(27215): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=54; index=68
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.content.res.StringBlock.get(StringBlock.java:64)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.content.res.XmlBlock$Parser.getPooledString(XmlBlock.java:458)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.content.res.TypedArray.loadStringValueAt(TypedArray.java:720)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.content.res.TypedArray.getString(TypedArray.java:124)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.widget.TextView.&lt;init&gt;(TextView.java:928)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.widget.Button.&lt;init&gt;(Button.java:107)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    at android.widget.Button.&lt;init&gt;(Button.java:103)
  07-13 13:24:21.872: E/AndroidRuntime(27215):    ... 37 more
  </code></pre>
  
  <p><strong>EDIT:</strong> Here's the mentioned layout. I must also say I already tried to delete/replace the element that seemed to be causing the issue, but it would simply apply to another one.</p>
  
  <pre><code>&lt;LinearLayout 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:background="#F2F2F2"
      android:orientation="vertical"
      tools:context=".NumberActivity" &gt;
  
      &lt;TextView
          android:id="@+id/displayTextView"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"
          android:fontFamily="Lato"
          android:gravity="center"
          android:text="0"
          android:textColor="#F07B7B"
          android:textSize="70dp"
          android:typeface="normal"
          tools:ignore="SpUsage" /&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@drawable/clear_next_background" &gt;
  
          &lt;ImageView
              android:id="@+id/clearCrossImageView"
              android:layout_width="wrap_content"
              android:layout_height="30dp"
              android:layout_alignParentLeft="true"
              android:layout_centerVertical="true"
              android:layout_marginLeft="5dp"
              android:adjustViewBounds="true"
              android:contentDescription="@string/clear_number"
              android:paddingRight="0dp"
              android:src="@drawable/clear_cross_png" /&gt;
  
          &lt;ImageView
              android:id="@+id/nextArrowImageView"
              android:layout_width="wrap_content"
              android:layout_height="30dp"
              android:layout_alignParentRight="true"
              android:layout_alignTop="@+id/clearCrossImageView"
              android:layout_centerVertical="true"
              android:layout_marginRight="5dp"
              android:adjustViewBounds="true"
              android:contentDescription="@string/next"
              android:cropToPadding="false"
              android:paddingLeft="0dp"
              android:src="@drawable/next_arrow_png" /&gt;
  
          &lt;Button
              android:id="@+id/clearButton"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentTop="true"
              android:layout_toRightOf="@+id/clearCrossImageView"
              android:background="@drawable/clear_next_background"
              android:text="@string/clear_number"
              android:textAllCaps="true"
              android:textColor="#ffffff" /&gt;
  
          &lt;Button
              android:id="@+id/nextButton"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentTop="true"
              android:layout_toLeftOf="@+id/nextArrowImageView"
              android:background="@drawable/clear_next_background"
              android:text="@string/next"
              android:textAllCaps="true"
              android:textColor="#ffffff" /&gt;
  
      &lt;/RelativeLayout&gt;
  
      &lt;TableLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;TableRow
              android:id="@+id/tableRow1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" &gt;
  
              &lt;Button
                  android:id="@+id/button7"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="7"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
              &lt;Button
                  android:id="@+id/button8"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="8"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
              &lt;Button
                  android:id="@+id/button9"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="9"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
          &lt;/TableRow&gt;
  
          &lt;TableRow
              android:id="@+id/tableRow2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="1" &gt;
  
              &lt;Button
                  android:id="@+id/button4"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="4"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
              &lt;Button
                  android:id="@+id/button5"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="5"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
              &lt;Button
                  android:id="@+id/button6"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="6"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
          &lt;/TableRow&gt;
  
          &lt;TableRow
              android:id="@+id/tableRow3"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" &gt;
  
              &lt;Button
                  android:id="@+id/button1"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="1"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
              &lt;Button
                  android:id="@+id/button2"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="2"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
              &lt;Button
                  android:id="@+id/button3"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="3"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
          &lt;/TableRow&gt;
  
          &lt;TableRow
              android:id="@+id/tableRow4"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:weightSum="6" &gt;
  
              &lt;ImageButton
                  android:id="@+id/delImageButton"
                  android:layout_width="0dp"
                  android:layout_height="fill_parent"
                  android:layout_weight="2"
                  android:background="@drawable/number_button"
                  android:contentDescription="@string/delete_button_description"
                  android:cropToPadding="true"
                  android:padding="17dp"
                  android:scaleType="fitCenter"
                  android:src="@drawable/del_button_png" /&gt;
  
              &lt;Button
                  android:id="@+id/button0"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="2"
                  android:background="@drawable/number_button"
                  android:text="0"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
              &lt;Button
                  android:id="@+id/buttonComma"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="@string/comma"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
              &lt;Button
                  android:id="@+id/buttonPlusMinus"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@drawable/number_button"
                  android:text="+/-"
                  android:textColor="#ffffff"
                  android:textSize="25dp"
                  tools:ignore="HardcodedText" /&gt;
  
          &lt;/TableRow&gt;
      &lt;/TableLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>EDIT 2:</strong> I found that putting those string resources together with the others in the res/values/strings.xml file has the same effect, so I guess there is some problem with those resources. I list them below.</p>
  
  <pre><code>&lt;string name="category_angles"&gt;Angles&lt;/string&gt;
  &lt;string name="category_area"&gt;Area&lt;/string&gt;
  &lt;string name="category_electricity"&gt;Electricity&lt;/string&gt;
  &lt;string name="category_kitchen"&gt;Kitchen&lt;/string&gt;
  &lt;string name="category_data"&gt;Data&lt;/string&gt;
  &lt;string name="category_energy"&gt;Energy&lt;/string&gt;
  &lt;string name="category_force"&gt;Force&lt;/string&gt;
  &lt;string name="category_frequency"&gt;Frequency&lt;/string&gt;
  &lt;string name="category_illumination"&gt;Illumination&lt;/string&gt;
  &lt;string name="category_luminance"&gt;Luminance&lt;/string&gt;
  &lt;string name="category_lenght"&gt;Lenght&lt;/string&gt;
  &lt;string name="category_mass"&gt;Mass&lt;/string&gt;
  &lt;string name="category_power"&gt;Power&lt;/string&gt;
  &lt;string name="category_pressure"&gt;Pressure&lt;/string&gt;
  &lt;string name="category_temperature"&gt;Temperature&lt;/string&gt;
  &lt;string name="category_time"&gt;Time&lt;/string&gt;
  &lt;string name="category_typography"&gt;Typography&lt;/string&gt;
  &lt;string name="category_torsion"&gt;Torsion&lt;/string&gt;
  &lt;string name="category_currencies"&gt;Currencies&lt;/string&gt;
  &lt;string name="category_speed"&gt;Speed&lt;/string&gt;
  &lt;string name="category_internet_speed"&gt;Internet speed&lt;/string&gt;
  &lt;string name="category_volume"&gt;Volume&lt;/string&gt;
  </code></pre>
  
  <p><strong>EDIT 3:</strong> I checked my R.java generated file to be sure it isn't a resources generator issue, but it looks fine. Pasting the strings section below.</p>
  
  <pre><code>public static final class string {
      public static final int action_settings=0x7f060017;
      public static final int animations_duration=0x7f060022;
      public static final int app_name=0x7f060016;
      public static final int categories_fragment_name=0x7f060021;
      public static final int category_angles=0x7f060000;
      public static final int category_area=0x7f060001;
      public static final int category_currencies=0x7f060012;
      public static final int category_data=0x7f060004;
      public static final int category_electricity=0x7f060002;
      public static final int category_energy=0x7f060005;
      public static final int category_force=0x7f060006;
      public static final int category_frequency=0x7f060007;
      public static final int category_illumination=0x7f060008;
      public static final int category_internet_speed=0x7f060014;
      public static final int category_kitchen=0x7f060003;
      public static final int category_lenght=0x7f06000a;
      public static final int category_luminance=0x7f060009;
      public static final int category_mass=0x7f06000b;
      public static final int category_power=0x7f06000c;
      public static final int category_pressure=0x7f06000d;
      public static final int category_speed=0x7f060013;
      public static final int category_temperature=0x7f06000e;
      public static final int category_time=0x7f06000f;
      public static final int category_torsion=0x7f060011;
      public static final int category_typography=0x7f060010;
      public static final int category_volume=0x7f060015;
      public static final int clear_number=0x7f060019;
      public static final int comma=0x7f06001d;
      public static final int delete_button_description=0x7f06001b;
      public static final int display_placeholder=0x7f06001c;
      public static final int hello_world=0x7f060020;
      public static final int history=0x7f060023;
      public static final int main_activity_name=0x7f06001e;
      public static final int next=0x7f06001a;
      public static final int number_fragment_name=0x7f060018;
      public static final int title_activity_category_list=0x7f06001f;
  }
  </code></pre>