Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding two XML files causes a rendering bug/something. Wat?
    primarykey
    data
    text
    <p>Is there some XML/layout/resource limit to Android projects / some point in the compiling toolchain? Adding a single (unused, any contents) XML layout file to my Android project is causing a rendering bug elsewhere in the app. Removing it fixes it. Is this a bug in some part of the compiling toolchain, and how can I diagnose / fix it?</p> <hr> <p><strong>Some additional context:</strong></p> <p>I have a relatively large Android project. Today I ran across a problem while adding a feature: a background-drawable of a button wasn't rendering until I rotated the application. Other backgrounds / styles / styled buttons are still working, but this one background is very much broken, everywhere in the application. Rotating fixes the screen it's on, and every later instance of the button, until restarting the application's process.</p> <p>After a <em>lot</em> of trial and error, and bisecting and experimentation, I have some level of a minimal reproduction that is perfectly reliable: adding two more XML layout files to my current project triggers the bug. Specifically, adding the 40th XML file in the only /res/layout folder. Removing it lets the button render properly, adding it breaks it.</p> <p>The files can be completely unused, completely from scratch, with any contents, and any name. No other project changes. I'm running an up-to-date version of Eclipse and the Android SDK - I can get specific version numbers if desired. It has been replicated with this project on a coworker's machine with a similar setup. I've cleaned, rebuilt, manually deleted build products, restarted my computer, the bug persists.</p> <p>There must be something more specific causing it, and I would love suggestions to help narrow it down. Unfortunately it has gone beyond my knowledge of the Android build system, and it doesn't seem to be something directly caused by me. Can anyone help? Or point me to some further resources?</p> <hr> <p><strong>More details</strong>:</p> <ul> <li>(can't believe I forgot this) this only seems to happen on the 2.3.6 devices I have. It might be happening on other 2.x versions, but a 4.2.2 renders the button correctly all the time (though I haven't / can't rule out a bug in another location). I'll be trying emulators today.</li> <li>Happens on multiple Android devices, though they're all essentially stock (no custom themes, etc).</li> <li>Current app setup is a core-app project, with three other projects that use that core project to produce different builds (dev, production, etc) via manifest merging.</li> <li>That particular drawable resource has a unique R id as it should, so it doesn't appear to be a collision there. I have not compared it to system R values - is there a good way to do so?</li> <li>Target SDK = 17, minimum = 8</li> </ul> <hr> <p><strong>Also interesting</strong>: renaming the drawable file from "rounded_teal_button_normal" to "rounded_teal_button_nrml" doesn't change anything, but changing it to "rounded_teal_button_aargh" <em>does</em>. Only important difference I can see there is that "nrml" doesn't change the alphabetical ordering of the files, while "aargh" does (there's a "_disabled" file, and "_pressed"). This does, however, cause the drawable that is now in the 'normal' position to stop drawing.</p> <p>Changing the button state-selector's ordering of items or which state gets which drawable (or even removing all other styles) doesn't have any effect.</p> <p>Adding a <em>third</em> XML file causes the problem to disappear, and it doesn't seem to be causing alphabetically-nearby drawables to break, but it's very hard to be sure it's solving <em>everything</em>, and the 'why' question remains.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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