Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (retired 2014) Getting Started with Android Initial Layout

The emulator is not working :(

The console shows "[2014-05-11 04:42:58 - CrystalBall] Error in an XML file: aborting build."

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

The XML files are the layout files. Can you copy the entire contents of your activity_main.xml file and paste it in here? Don't worry about formatting...I'll edit it and make sure it shows. Or take a look at the Markdown Cheatsheet below for tips on posting code.

Thank you so much for your help !!! :)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.wenynwang.crystalball.MainActivity$PlaceholderFragment" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textSize="32sp" />

    <Button
        android:id="@+id/button1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView1"
        android:layout_centerHorizontal="true"
        android:text="Enlighten me!" />

</RelativeLayout>
Ben Jakuben
Ben Jakuben
Treehouse Teacher

Okay! Your code looks good, so it must be something else. Do you get any other error indicators about which file it might be? It could be an error in another XML file, like AndroidManifest.xml or strings.xml, or perhaps even an error in a file name.