XML Layout - Entry Identifier 0x11a is larger than entry count 0xb2 - android

'Entry Identifier 0x11a is larger than entry count 0xb2'
This is what's printed in my LogCat when switching to a specific fragment.
I think it may have something to do with my 'xml layout' resource being inflated. I am not sure what though.
My Question
Has anybody else had this problem or know what it means?
Thanks for your help

I've encountered this problem and worked around it with a hack. I added an empty style at the top of my styles.xml:
<style name="empty_style" />
According to this discussion on Google Groups the error occurs
...when HistoryRecord over in the framework is trying to read the theme defined in your resources. There isn't anything wrong with the code [...]. In fact, if you fiddle around with the ordering in your styles.xml, usually adding a few empty blocks near the top, might help get around this
temporarily.
I can't say if the cause quoted above is real, but it removed the issue for me. Hope this helps.

Related

what happens when there are ambiguous attributes in android layout xml?

I have this layout xml
does order matter?
I mean what will be the padding?
what would happen if the same attribute repeat twice? compilation error?
4,4,4,0
or 4,4,4,4
or non deterministic?
As for already existing attribute, you cant use the same attribute more than once in the same XML tag.
If you do try to use the same attribute twice you will get “duplicate attribute” XML error.
I'm sorry, I completely miss understood your question in my previous answer and made a mistake myself.
I'm not sure where you can find this in the android docs, but from my own experience you cannot provide the same attribute twice (this would lead to a compilation error).
To update my previous answer (I've edited this post to get rid of it, so I don't confuse or mislead any one), with the padding example I gave, padding overrides padding-top no matter what order you put them in.
Also I'm sorry for the slow response, I've been away for a few weeks and only just got back. I hope you found a better answer before I updated this post and I'll be quicker to clarify anything if you want me to.

How can I track down the cause of Android "found an invalid color" error

During build of my android application I am getting the following error:
:app:mergeDev_testingDebugResources
error: found an invalid color.
I don't get any line of code or even which file it is having a problem with. I have a large number of outstanding changes (stupid me) which I don't want to roll back - but I'm totally stumped as to how to work out what is wrong.
For future reference - this error is what you get if you have added an image as a 9-pack and it isn't yet properly formatted with the black pixel borders. The error message could be far more helpful, i.e. actually saying which file the error occurs with would be nice, but the solution is just to go through all your 9 pack files in Android Studio and open then save each of them.
First of all, check your layout directory in file explorer bcoz when you have made changes in the main layout file then you could have changed respective example: v-21 or v-13 layout file too. This error occurs when you apply some element property which is not supported by previous versions like v-21.
I hope I have given detail about this, if any explanations are needed plz let me know.
Yes, the problem is in 9-path image. At least in my case.
The problem was in black lines in the borders of image. It should be only black and transparent. Nothing else. In my case there was shadow from view with alpha. With photoshop I remove any color pixels of borders (except black lines)
At Android Studio launch Analyze -> Inspect code. Then resolve all errors
In my case , i have done mistake while writing color,
like -
<color name="mainBackground">#8e00ed></color>
then look i have added extra symbol this-">" after my color ,
it should only be
<color name="mainBackground">#8e00ed</color
Then it worked fine for me.
Just check between two symbols "only color code" should come "no extra symbols,no apostophies,no semicolons" should be there.
Thank You!!!

"Too many attribute references" warning

I have an app, where some fragments only consist of ListViews. Some of my users with low-end devices experience a phenomenon, where a fragment simply can not display the data. When they enter the fragment I display a ProgressBar, and this ProgressBar seems to spin forever.
So I bought a low-end device and am facing the same problem. I get the data for the ListView with a network request to my backend API, but the answer is never returned. The only warning I see so far is
W/ResourceType﹕ Too many attribute references, stopped at: 0x01010034
I could not find much about this error in the web but it seems like this warning is logged here https://github.com/SciAps/android-frameworks-base/blob/c693209edc3696884c1fcd59790dda0b9811d017/libs/utils/ResourceTypes.cpp#L1573, but I don't understand what the Android code is doing there.
Anyone has a clue about what's going on here, what's the problem and how I can fix that?
BTW I use RoboSpice and Retrofit to do the network requests. The background service that is responsible for getting the data is stopped after this warning, that's why I never get back data.
EDIT As far as I can tell not seeing the data has nothing to do with the warning. Anyway, what does this warning mean and how can I prevent it?
I accidentally applied a style as a theme on a view, which resulted in this warning showing up. In the view's XML, by using style="#style/MyStyle" instead of android:theme="#style/MyStyle" I was able to stop the warnings.
Actually, the most upvoted answer by #Corclark was not entirely accurate in my case. I got the same warning, but didn't have the style="#style/MyStyle" set anywhere. I experimented a bit and found out it was actually this line that caused the warning for me:
android:theme="#style/My.Switch"
Then, I found this answer. Changing the style of My.Switch to
<style name="My.Switch" parent="">
<item name="android:background">#color/dark_grey</item>
<item name="colorAccent">#color/Unpluq</item>
</style>
resolved the warning for me. Hope it might still be helpful to some.
It happens when using ContextThemeWrapper for creating new ElementViews
TextView txtView= new TextView(new ContextThemeWrapper(context, R.style.styleName));

Android layout style differences

I am trying to understand the difference between the above 2 styles. It appears after reading various posts the correct way of doing this is assigning the holo theme in the manifest and then doing
style="?android:attr/borderlessButtonStyle"
but it appears you can also do this
style="#android:style/Widget.Holo.Light.Button.Borderless.Small"
which one is correct? Is one an alias for the other?
I must admit the second 1 seems easier to read and understand, its pointing to an internal style - right?
and the 1st one? this is a style or just an attribute within a style?
In the 1st one it also starts with a question mark, what purpose does this have ?
anybody have a good insight into this ?
which one is correct?
Both/either, depending upon your objective.
Is one an alias for the other?
The first one says "there's an attribute in the theme that will indicate what style to use here". The second one says "use this style".

Annoying default formatting

I am working on a simple android application in eclipse IDE and I got a little yellow icon on the left hand side of a line of xml code that looks like a light bulb with an exclamation mark beside it. When I hovered over, it says "[I18N] Hardcoded string "input..., should use #string resource input". The running and debug was successful but I just want to get rid of it as I find it annoying. What should I do?
If it's annoying, there is a reason. You totally should use #string resources instead of your hardcoded strings. All you have to do is to put your string in res/values/strings.xml and reference it in your layout via #string/my_string_id_here.
This is extremely useful for multi language support, or for plurals strings.
You can learn more here.
Hope this will help you.
The right way:
Move all your strings into resource files, as suggested, and reference them in your views like so: #string/mystringname
The "other" way:
Turn off Lint warnings in Eclipse in Window/Preferences/Android/Lint Error Checking
Both ways will remove that annoying triangle :)
This warning is there because hardcoding strings into the android app's Java source code is not recommended. It will compile fine - but Android Lint will complain about it, so that's why it's a "warning" and not an "error". Generally, it is preferable to define them in the separate "string.xml" file.
If you want to know why, check this answer.
For an example, check this answer.
You should also take a look at the official documentation for string resources.

Categories

Resources