1. Download our Official Android App: Forums for Android!

Apps New Developer with a problem. PLEASE HELP

Discussion in 'Android Development' started by Cliff254, Jan 8, 2010.

  1. Cliff254

    Cliff254 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jan 8, 2010

    Jan 8, 2010
    2
    0
    5
    Hello all!

    I am in the process of trying to become a new developer and have read some stuff from different java books and now am attempting to create my first program, my hello world in eclipse. The book i am now using to learn android programing is "Android Application Development" by Rogers, Lombardo, Mednieks & Meike published by O'Reilly, ISBN number: 978-0-596-52147-9. i have followed all of the steps in the book to create my hello world (i believe) and have done as follows:

    new android project
    project name:HelloWorld
    Application name: HelloWorld
    Package name: com.oreilly.helloworld
    Build Target: android 2.0 (i really dont know what to choose)
    I have not edited the helloworldactivity.java file (like the book tells me to)
    I have left the main.xml file as is aswell.
    In strings.xml i have edited the hello string to have a value of "Hello Android!" like the book told me to and it is reflected in the main.xml file by showing the little black screen that sais "Hello Android!" (like the book told me to)
    after i do this i go to run the file like the book tells me to by going to run -> run, and then selecting android application and clicking "ok" and it does not run and i get the error as follows:

    [2010-01-08 00:19:29 - HelloWorld]Error in an XML file: aborting build.
    [2010-01-08 00:19:29 - HelloWorld]res\layout\main.out.xml:0: error: Resource entry main is already defined.
    [2010-01-08 00:19:29 - HelloWorld]res\layout\main.out.out.xml:0: Originally defined here.
    [2010-01-08 00:19:29 - HelloWorld]res\layout\main.xml:0: error: Resource entry main is already defined.
    [2010-01-08 00:19:29 - HelloWorld]res\layout\main.out.out.xml:0: Originally defined here.
    [2010-01-08 00:19:29 - HelloWorld]C:\Users\Andrew\workspace\HelloWorld\res\layout\main.out.out.xml:1: error: Error parsing XML: no element found
    [2010-01-08 00:19:29 - HelloWorld]C:\Users\Andrew\workspace\HelloWorld\res\layout\main.out.xml:1: error: Error parsing XML: no element found


    I have NO IDEA what is wrong! can someone please help me out?
    I Desperately want to make Android Applications!!
     

    Advertisement

  2. eclipsed4utoo

    eclipsed4utoo Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    435
    Joined:
    Nov 12, 2009

    Nov 12, 2009
    435
    27
    43
    Software Developer
    Florence, SC
    open the "ma in.out.out.xml" and the "ma in.out.xml" files. If there are errors in those files, they will have red lines underneath them.
     
  3. KeithG

    KeithG Well-Known Member
    Rank:
    None
    Points:
    46
    Posts:
    103
    Joined:
    Nov 15, 2009

    Nov 15, 2009
    103
    3
    46
    In the project explorer delete the main.out.xml

    You attempted to "run" the xml file. You had it selected in the project/package explorer when you hit the run button.

    Before you hit run, make sure you have either your main activity class or the top level project folder selected when you hit the run button.

    happy coding.
     
    wado1 likes this.
  4. Cliff254

    Cliff254 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jan 8, 2010

    Jan 8, 2010
    2
    0
    5
    Keith, that worked perfectly! Thank you soo much!!
     
  5. phiredrop

    phiredrop Lurker
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    May 13, 2010

    May 13, 2010
    2
    0
    5
    Hey guys - I really need help with this.

    I'm running into the same error where it says "Error in an XML file: aborting build."
    But there is no error I can find, and nothing seems to be helping. Not restarting eclipse, not closing and reopening the project - I can't figure it out.

    Any ideas?? Thanks!
     
  6. wado1

    wado1 Member
    Rank:
    None
    Points:
    16
    Posts:
    31
    Joined:
    Jul 24, 2010

    Jul 24, 2010
    31
    4
    16
    Thanks Keith.
     

Share This Page

Loading...