Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm pretty sure I've had this same problem. I'm willing to bet it has nothing to do with the OS. It's caused by that thing in Android where you can substitute one <code>Drawable</code> for another depending on your theme or some other condition. It turns out that the Android resource compiler doesn't (always? ever?) check if there's anything 'real' behind an alias.</p> <p>Here is how you debug it...</p> <p>Start with this line, it tells you something specific about what is missing--the ID:</p> <p><code>Caused by: android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x1/d=0x7f0d014c a=3 r=0x7f0d014c}</code></p> <p>Now go to <code>bin/R.text</code>, and search for the ID code that is given: <code>0x7f0d014c</code>. There should be something like this: <code>int attr actionModeCloseDrawable 0x7f0d014c</code></p> <p>Now look for the name <code>actionModeCloseDrawable</code> or whatever it is in your workspace. I believe that you will find that it is an alias for a non-existent resource. i.e., there is a configuration (version number, screen size, etc.) under which that attr does not map to anything at all.</p> <p>Important things to note: Make sure to check ALL places where you find <code>actionModeCloseDrawable</code> or whatever it is. It might look like it is in a place where it 'doesn't matter' but this was a second problem encountered: after I 'fixed' the issue in one <code>abc_myfragment.xml</code>, I actually had to fix it in <code>abc_myfragment_large.xml</code> -- Android was automatically calling a different xml file than the one specified in code, based on the device I happened to be running it on.</p> <p>The top line of your stack trace should help you verify that you are looking in the right place: <code>android.view.InflateException: Binary XML file line #45: Error inflating class</code></p> <p>This tells you that the missing <code>ColorStateList</code> is being referred to in a section of some XML file somewhere, and that that troublesome section starts on line 45 (i.e., that's where the open angle bracket --"&lt;"-- starting the section is.)</p> <p>PS What I mean by alias is one of these:</p> <p><code>&lt;attr name="abc_my_home_button" format="reference" /&gt;</code></p> <p>which gets separate further definitions in two separate themes:</p> <p><code>&lt;item name="afc_button_home"&gt;@drawable/afc_button_home_light&lt;/item&gt;</code> in the file themes_light.xml</p> <p>and</p> <p><code>&lt;item name="afc_button_home"&gt;@drawable/afc_button_home_dark&lt;/item&gt;</code> in the file themes_dark.xml</p> <p>The trouble arises when you leave the final definition out of one of the theme files.</p> <p><strong>EDIT</strong></p> <p><strong>Next step:</strong> Investigate <code>CustomActionBar</code>'s dependencies. I'm not an expert on styles, so I will assume there are 9 possible places remaining where Android might see a reference to a <code>ColorStateList</code> that it can't find: in the parent of <code>CustomActionBar</code> (<code>Widget.Sherlock.Light.ActionBar.Solid.Inverse</code>), and in each of the 8 items it contains. Comment out those 8 items and get rid of the parent, then rerun your app in the troublesome configuration. Check if the runtime error goes away or, more likely, changes (e.g., line number (and id) changes from #45 to indicate <code>CustomActionBar.Facebook</code> instead, where many of the same resources are invoked). Then undo the changes one by one until the error changes back to what it was before. This will further localize the problem. After attempting a fix, move slowly, since it is possible that if you do find the problem (e.g., as a non-existent reference) it is replicated in multiple of the 8 items. So uncomment one by one. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload