Android : Error building android XML layout, r file not generating

on Sunday, July 6, 2014


So my only layout in my program right now is this activity_main file. I have a MainActivity class. Im getting a build error when saving the xml file and also my R file is not being generated. I read the R file not generating has to do with an xml error. The errors aren't being caught by eclipse in my cml even when it is building. I've included my string xml file, layout file, and android manifest. Help would be greatly appreciated, thanks.




Strings XML File



<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">django mouse</string>
<string name="title_activity_main">MainActivity</string>
<string name="hello_world">Hello world!</string>
<string name="welcome_header">Welcome to Django</string>
<string name="start_instructions">To begin enter your local ip address and then click the start button</string>
<string name="pebb_accel_header">Pebble Accelerometer Data</string>
<string name="main_x_coordinate">X: </string>
<string name="main_y_coordinate">Y: </string>
<string name="main_z_coordinate">Z: </string>
<string name="up_button">up</string>
<string name="down_button">down</string>
<string name="left_button">left</string>
<string name="right_button">right</string>
<string name="click_button">click</string>
<string name="start_button">start</string>

</resources>


activity_main



<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:orientation="vertical"
android:paddingBottom="20dp"
tools:context=".MainActivity"
tools:ignore="MergeRootFrame" >

<TextView
android:id="@+id/welcome_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center_horizontal"
android:text="@string/welcome_header"
android:textColor="@color/Black"
android:textSize="22sp" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
android:id="@+id/start_stop_instructions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="75dp"
android:text="@string/start_instructions"
android:textColor="@color/Black"
android:textSize="18sp" />

<TextView
android:id="@+id/welcome_sub_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/start_stop_instructions"
android:paddingTop="16dp"
android:text="@string/pebb_accel_header"
android:textColor="@color/Black"
android:textSize="18sp" />

<LinearLayout
android:id="@+id/accel_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/pebb_accel_header"
android:orientation="vertical" >

<TextView
android:id="@+id/main_x_coordinate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/main_x_coordinate"
android:textColor="@color/Black" />

<TextView
android:id="@+id/main_y_coordinate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/main_y_coordinate"
android:textColor="@color/Black" />

<TextView
android:id="@+id/main_z_coordinate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/main_z_coordinate"
android:textColor="@color/Black" />
</LinearLayout>

<Button
android:id="@+id/up_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/accel_data"
android:layout_centerHorizontal="true"
android:layout_marginTop="32dp"
android:text="@string/up_button" />

<Button
android:id="@+id/down_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/up_button"
android:layout_centerHorizontal="true"
android:layout_marginTop="48dp"
android:text="@string/down_button" />

<Button
android:id="@+id/left_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/up_button"
android:layout_toLeftOf="@id/up_button"
android:text="@string/left_button" />

<Button
android:id="@+id/right_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/up_button"
android:layout_toRightOf="@id/up_button"
android:text="@string/right_button" />

<Button
android:id="@+id/click_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/up_button"
android:layout_toLeftOf="@id/right_button"
android:layout_toRightOf="@id/left_button"
android:text="@string/click_button" />
</RelativeLayout>

<Button
android:id="@+id/main_start_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="@string/start_button"

</RelativeLayout>`


Android Manifest



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.housedroid.djangomouse"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.housedroid.djangomouse.MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

0 comments:

Post a Comment