Results 1 to 4 of 4
  1. #1
    j_arif123 is offline Member
    Join Date
    Jan 2012
    Location
    India
    Posts
    34
    Rep Power
    0

    Default An Error : Failed to configure parser - Help me to fix it -i'm new to android.

    Hello ,
    I'm stuck up with an error message after making an activity simply showing a number of views on it.I did not write any functionality yet. This is my acitivity file :



    XML Code:
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="top"
        android:orientation="vertical"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:textAlignment="center"
        tools:context=".SampleMain" >
    
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:layout_marginBottom="100dp"
            android:layout_marginLeft="10dp"
            android:padding="10dp"
            android:text="@string/welcome_message"
            android:textColor="@layout/activity_sample_main"
            android:textSize="20sp" />
    
        <EditText
            android:id="@+id/editText1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/search_hint"
            android:inputType="text" />
    
        <Button
            android:id="@+id/button1"
            android:layout_width="266dp"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/button_margin"
            android:text="@string/search_button_caption" />
     
    </LinearLayout>
    The manifest file is :

    XML Code:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.learning.sampleapp"
        android:versionCode="1"
        android:versionName="1.0" >
    
        <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="17" />
    
        <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name="com.learning.sampleapp.SampleMain"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    
    </manifest>
    Java file :

    Java Code:
    package com.learning.sampleapp;
    
    import android.os.Bundle;
    import android.app.Activity;
    import android.view.Menu;
    
    public class SampleMain extends Activity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_sample_main);
        }
    
    
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            // Inflate the menu; this adds items to the action bar if it is present.
            getMenuInflater().inflate(R.menu.sample_main, menu);
            return true;
        }
        
    }
    Strings.xml :

    XML Code:
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    
        <string name="app_name">Search Now</string>
        <string name="action_settings">Settings</string>
        <string name="welcome_message">Welcome to search now app</string>
        <string name="search_hint">Type some text to search here . . . </string>
        <string name="search_button_caption">Search Now</string>
    
    </resources>
    dimens.xml :
    XML Code:
    <resources>
    
        <!-- Default screen margins, per the Android Design guidelines. -->
        <dimen name="activity_horizontal_margin">16dp</dimen>
        <dimen name="activity_vertical_margin">16dp</dimen>
        <dimen name="button_margin">10dp</dimen>
      
    
    </resources>

    So, these are files I have . And This is the error log file :


    !ENTRY com.android.ide.eclipse.adt 4 0 2013-06-17 18:45:47.056
    !MESSAGE activity_sample_main.xml: Failed to configure parser for D:\MobileDevelopment\AndroidNewWS\SampleApp\res\la yout\activity_sample_main.xml
    !STACK 0
    org.xmlpull.v1.XmlPullParserException: Binary XML file line #12: invalid drawable tag LinearLayout
    .................................................. ....

    !ENTRY com.android.ide.eclipse.adt 4 0 2013-06-17 18:54:04.225
    !MESSAGE activity_sample_main.xml: Failed to configure parser for D:\MobileDevelopment\AndroidNewWS\SampleApp\res\la yout\activity_sample_main.xml
    !STACK 0
    org.xmlpull.v1.XmlPullParserException: Binary XML file line #12: invalid drawable tag LinearLayout
    .................................................. ...

    !ENTRY com.android.ide.eclipse.adt 4 0 2013-06-17 18:54:15.800
    !MESSAGE activity_sample_main.xml: Failed to configure parser for D:\MobileDevelopment\AndroidNewWS\SampleApp\res\la yout\activity_sample_main.xml
    !STACK 0
    org.xmlpull.v1.XmlPullParserException: Binary XML file line #12: invalid drawable tag LinearLayout
    at android.content.res.ColorStateList.createFromXmlIn ner(ColorStateList.java:146)
    at android.content.res.ColorStateList.createFromXml(C olorStateList.java:129)
    at android.content.res.BridgeTypedArray.getColorState List(BridgeTypedArray.java:373)
    at android.widget.TextView.<init>(TextView.java:904)
    at android.widget.TextView.<init>(TextView.java:578)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at android.view.LayoutInflater.createView(LayoutInfla ter.java:587)
    at android.view.BridgeInflater.onCreateView(BridgeInf later.java:86)
    at android.view.LayoutInflater.onCreateView(LayoutInf later.java:660)
    at android.view.LayoutInflater.createViewFromTag(Layo utInflater.java:685)
    at android.view.BridgeInflater.createViewFromTag(Brid geInflater.java:131)
    at android.view.LayoutInflater.rInflate_Original(Layo utInflater.java:746)
    at android.view.LayoutInflater_Delegate.rInflate(Layo utInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflate r.java:718)
    at android.view.LayoutInflater.inflate(LayoutInflater .java:489)
    at android.view.LayoutInflater.inflate(LayoutInflater .java:372)
    at com.android.layoutlib.bridge.impl.RenderSessionImp l.inflate(RenderSessionImpl.java:385)
    at com.android.layoutlib.bridge.Bridge.createSession( Bridge.java:332)
    at com.android.ide.common.rendering.LayoutLibrary.cre ateSession(LayoutLibrary.java:325)
    at com.android.ide.eclipse.adt.internal.editors.layou t.gle2.RenderService.createRenderSession(RenderSer vice.java:440)
    at com.android.ide.eclipse.adt.internal.editors.layou t.gle2.GraphicalEditorPart.renderWithBridge(Graphi calEditorPart.java:1545)
    at com.android.ide.eclipse.adt.internal.editors.layou t.gle2.GraphicalEditorPart.recomputeLayout(Graphic alEditorPart.java:1302)
    at com.android.ide.eclipse.adt.internal.editors.layou t.gle2.GraphicalEditorPart.activated(GraphicalEdit orPart.java:1059)
    at com.android.ide.eclipse.adt.internal.editors.layou t.LayoutEditorDelegate.delegatePageChange(LayoutEd itorDelegate.java:686)
    at com.android.ide.eclipse.adt.internal.editors.commo n.CommonXmlEditor.pageChange(CommonXmlEditor.java: 360)
    at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSe lected(MultiPageEditorPart.java:292)
    at org.eclipse.swt.widgets.TypedListener.handleEvent( TypedListener.java:248)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Event Table.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:1053)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:1077)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:1062)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Wid get.java:774)
    at org.eclipse.swt.custom.CTabFolder.setSelection(CTa bFolder.java:3028)
    at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFold er.java:1749)
    at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CT abFolder.java:278)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Event Table.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents( Display.java:4169)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Di splay.java:3758)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRende ringEngine$9.run(PartRenderingEngine.java:1053)
    at org.eclipse.core.databinding.observable.Realm.runW ithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRende ringEngine.run(PartRenderingEngine.java:942)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.c reateAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench. java:588)
    at org.eclipse.core.databinding.observable.Realm.runW ithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWork bench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Pl atformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplica tion.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle. run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.runApplication(EclipseAppLauncher.java: 110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework( Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.ja va:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:14 38)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1 414)

    !ENTRY com.android.ide.eclipse.adt 4 0 2013-06-17 18:56:31.718
    !MESSAGE activity_sample_main.xml: Failed to configure parser for D:\MobileDevelopment\AndroidNewWS\SampleApp\res\la yout\activity_sample_main.xml
    !STACK 0
    org.xmlpull.v1.XmlPullParserException: Binary XML file line #12: invalid drawable tag LinearLayout

    !ENTRY com.android.ide.eclipse.adt 4 0 2013-06-17 18:56:35.368
    !MESSAGE activity_sample_main.xml: Failed to configure parser for D:\MobileDevelopment\AndroidNewWS\SampleApp\res\la yout\activity_sample_main.xml
    !STACK 0
    org.xmlpull.v1.XmlPullParserException: Binary XML file line #12: invalid drawable tag LinearLayout


    !ENTRY com.android.ide.eclipse.adt 4 0 2013-06-17 18:56:43.043
    !MESSAGE activity_sample_main.xml: Failed to configure parser for D:\MobileDevelopment\AndroidNewWS\SampleApp\res\la yout\activity_sample_main.xml
    !STACK 0
    org.xmlpull.v1.XmlPullParserException: Binary XML file line #12: invalid drawable tag LinearLayout


    !ENTRY com.android.ide.eclipse.adt 4 0 2013-06-17 18:57:05.835
    !MESSAGE activity_sample_main.xml: Failed to configure parser for D:\MobileDevelopment\AndroidNewWS\SampleApp\res\la yout\activity_sample_main.xml
    !STACK 0
    org.xmlpull.v1.XmlPullParserException: Binary XML file line #12: invalid drawable tag LinearLayout

    !ENTRY com.android.ide.eclipse.adt 4 0 2013-06-17 19:02:31.068
    !MESSAGE activity_sample_main.xml: Failed to configure parser for D:\MobileDevelopment\AndroidNewWS\SampleApp\res\la yout\activity_sample_main.xml
    !STACK 0
    org.xmlpull.v1.XmlPullParserException: Binary XML file line #12: invalid drawable tag LinearLayout

    !SESSION 2013-06-18 09:01:44.758 -----------------------------------------------
    eclipse.buildId=v22.0.1-685705
    java.version=1.7.0_21
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
    Framework arguments: -product com.android.ide.eclipse.adt.package.product
    Command-line arguments: -os win32 -ws win32 -arch x86_64 -product com.android.ide.eclipse.adt.package.product

    !ENTRY org.eclipse.egit.ui 2 0 2013-06-18 09:02:18.626
    !MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level
    Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory.
    The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in
    this system level configuration. The Git installation location can be configured on the
    Team > Git > Configuration preference page's 'System Settings' tab.
    This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

    !ENTRY org.eclipse.egit.ui 2 0 2013-06-18 09:02:18.626
    !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
    user global configuration and to define the default location to store repositories: 'C:\Users\Arif'. If this is
    not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
    EGit might behave differently since they see different configuration options.
    This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

    I think I have given all the things that you need to find out the error . And one thing I want to mention that when the app opens in the emulator , I get the following message : Unfortunately Sample App has stopped.
    Please visit http://www.tamililjava.blogspot.com a blog about java in Tamil language.Thank You

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,058
    Rep Power
    6

    Default Re: An Error : Failed to configure parser - Help me to fix it -i'm new to android.

    Line 22 of your layout file looks suspicious.
    Get in the habit of using standard Java naming conventions!

  3. #3
    j_arif123 is offline Member
    Join Date
    Jan 2012
    Location
    India
    Posts
    34
    Rep Power
    0

    Default Re: An Error : Failed to configure parser - Help me to fix it -i'm new to android.

    what does that line actually mean , could you say please ? I changed some properties of the textview under properities window . I dont know how that line 22 of layout crept into this code.
    Please visit http://www.tamililjava.blogspot.com a blog about java in Tamil language.Thank You

  4. #4
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,058
    Rep Power
    6

    Default Re: An Error : Failed to configure parser - Help me to fix it -i'm new to android.

    Not sure. It would be easy enough to find out if something's wrong with it by removing it.

    Honestly, most of the problems I have with Android manifests and layouts are solved by restarting Eclipse and/or toggling "build automatically". After that, I just Google the error message and hope for the best.
    Get in the habit of using standard Java naming conventions!

Similar Threads

  1. How to configure Android on Netbeans 6.8
    By chyrl in forum Advanced Java
    Replies: 5
    Last Post: 05-05-2013, 04:24 PM
  2. Replies: 1
    Last Post: 10-30-2011, 10:08 PM
  3. [Please Help] JCreator Error Failed to Find symbol
    By Theinnocentone in forum New To Java
    Replies: 5
    Last Post: 08-18-2011, 02:52 AM
  4. ERROR - Failed to run workflow compiler
    By Fineas in forum Eclipse
    Replies: 0
    Last Post: 11-17-2010, 01:05 PM
  5. JACOB error, putObject failed
    By MaJellin in forum New To Java
    Replies: 0
    Last Post: 03-05-2010, 08:17 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •