Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8404373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:35:00+00:00 2026-06-09T22:35:00+00:00

I have a regular button which looks like this: <Button android:id=@+id/button1 style=@style/ButtonInfo android:layout_width=match_parent android:layout_height=wrap_content

  • 0

I have a regular button which looks like this:

<Button
    android:id="@+id/button1"
    style="@style/ButtonInfo"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dip"
    android:layout_marginRight="10dip"
    android:text="Button" />

ButtonInfo looks like this:

 <style name="ButtonInfo" parent="@android:style/Widget.Button">
    <item name="android:background">@drawable/button_info</item>
    <item name="android:textColor">@color/button_info_text</item>
    <item name="android:textSize">16dip</item>
</style>

color/button_info_text.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true"><shape>
        <solid android:color="@color/black" />
    </shape></item>
<item><shape>
        <solid android:color="@color/white" />
    </shape></item>
</selector>

and I keep getting this in the error log:

eclipse.buildId=M20120208-0800
java.version=1.7.0_05
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=es_ES
Command-line arguments:  -os win32 -ws win32 -arch x86 -clean

Error
Tue Aug 21 12:17:57 CEST 2012
layout_guiacolor_info.xml: Failed to configure parser for C:\Documents and Settings\sanriv\Escritorio\GuiaColor\android\GuiaColor\res\drawable\button_info_text.xml

org.xmlpull.v1.XmlPullParserException: Binary XML file line #4: <item> tag requires a 'android:color' attribute.
    at android.content.res.ColorStateList.inflate(ColorStateList.java:226)
    at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:150)
    at android.content.res.ColorStateList.createFromXml(ColorStateList.java:129)
    at com.android.layoutlib.bridge.android.BridgeTypedArray.getColorStateList(BridgeTypedArray.java:338)
    at android.widget.TextView.<init>(TextView.java:628)
    at android.widget.Button.<init>(Button.java:108)
    at android.widget.Button.<init>(Button.java:104)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at android.view.LayoutInflater.createView(LayoutInflater.java:500)
    at com.android.layoutlib.bridge.android.BridgeInflater.onCreateView(BridgeInflater.java:84)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
    at com.android.layoutlib.bridge.android.BridgeInflater.createViewFromTag(BridgeInflater.java:129)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:296)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:279)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:318)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:325)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService.createRenderSession(RenderService.java:372)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1640)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1391)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ConfigListener.onConfigurationChange(GraphicalEditorPart.java:706)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.onTargetChange(GraphicalEditorPart.java:1293)
    at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate.onDescriptorsChanged(LayoutEditorDelegate.java:912)
    at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate.delegateInitUiRootNode(LayoutEditorDelegate.java:831)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$TargetListener.updateEditor(GraphicalEditorPart.java:1052)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$TargetListener.onTargetLoaded(GraphicalEditorPart.java:1016)
    at com.android.ide.eclipse.adt.AdtPlugin$10.run(AdtPlugin.java:1704)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

When I try to run it, I get this exception:

08-21 12:12:18.370: E/AndroidRuntime(14337): FATAL EXCEPTION: main
08-21 12:12:18.370: E/AndroidRuntime(14337): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cidaut.guiacolor/com.cidaut.guiacolor.controller.InfoActivity}: android.view.InflateException: Binary XML file line #37: Error inflating class <unknown>
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2079)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.app.ActivityThread.access$600(ActivityThread.java:132)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1157)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.os.Looper.loop(Looper.java:137)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.app.ActivityThread.main(ActivityThread.java:4575)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at java.lang.reflect.Method.invokeNative(Native Method)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at java.lang.reflect.Method.invoke(Method.java:511)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at dalvik.system.NativeStart.main(Native Method)
08-21 12:12:18.370: E/AndroidRuntime(14337): Caused by: android.view.InflateException: Binary XML file line #37: Error inflating class <unknown>
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.view.LayoutInflater.createView(LayoutInflater.java:606)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.app.Activity.setContentView(Activity.java:1835)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at com.cidaut.guiacolor.controller.InfoActivity.onCreate(InfoActivity.java:13)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.app.Activity.performCreate(Activity.java:4465)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)
08-21 12:12:18.370: E/AndroidRuntime(14337):    ... 11 more
08-21 12:12:18.370: E/AndroidRuntime(14337): Caused by: java.lang.reflect.InvocationTargetException
08-21 12:12:18.370: E/AndroidRuntime(14337):    at java.lang.reflect.Constructor.constructNative(Native Method)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.view.LayoutInflater.createView(LayoutInflater.java:586)
08-21 12:12:18.370: E/AndroidRuntime(14337):    ... 24 more
08-21 12:12:18.370: E/AndroidRuntime(14337): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/button_info_text.xml from color state list resource ID #0x7f020006
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.content.res.Resources.loadColorStateList(Resources.java:2113)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.content.res.TypedArray.getColorStateList(TypedArray.java:342)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.widget.TextView.<init>(TextView.java:774)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.widget.Button.<init>(Button.java:108)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.widget.Button.<init>(Button.java:104)
08-21 12:12:18.370: E/AndroidRuntime(14337):    ... 27 more
08-21 12:12:18.370: E/AndroidRuntime(14337): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #4: <item> tag requires a 'android:color' attribute.
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.content.res.ColorStateList.inflate(ColorStateList.java:226)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:150)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.content.res.ColorStateList.createFromXml(ColorStateList.java:129)
08-21 12:12:18.370: E/AndroidRuntime(14337):    at android.content.res.Resources.loadColorStateList(Resources.java:2110)
08-21 12:12:18.370: E/AndroidRuntime(14337):    ... 31 more

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:35:02+00:00Added an answer on June 9, 2026 at 10:35 pm

    Read first line in trace of error:

    org.xmlpull.v1.XmlPullParserException: Binary XML file line #4: <item> tag requires a 'android:color' attribute.
    

    Apparently your tag requires android:color attribute

    or maybe:
    Error : <item> tag requires a 'drawable' attribute or child tag defining a drawable

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am have buttons like this: <button type=button class=img img_button_bla onclick=...>Bla!</button> The img class
I have a windows form which has 1 button (for simplicity). On clicking this
I have a regular expression to validate the dates and it works fine, this
I have a regular expression which allows the value range '1111' - '999999', excluding
I have a regular expression which uses GroupCollection s in it's capture to capture
I have a regular expression to validate a input value. At this point I
I have this Regular Expression that matches the following strings: <!-- 09-02-2009 ---> <!--
SETUP : I have this app which has 4 activities in a linear path,
I have this problem where I have created a User Control which mimics a
I have a Windows Forms form in C#. It is just like a regular

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.