Note that there are some explanatory texts on larger screens.

plurals
  1. PONo XML content. Please add a root view or layout to your document
    primarykey
    data
    text
    <p>I am developing an android application. And i am new to XML. I am getting the message saying "No XML content. Please add a root view or layout to your document" The XML code is given below. Please help</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/ref" android:textSize="15dp"/&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/ref2" android:textSize="15dp"/&gt; &lt;EditText android:id="@+id/uname" android:layout_width="150dp" android:layout_height="25dp" android:inputType="text" android:ems="5" &gt; &lt;requestFocus /&gt; &lt;/EditText&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/ref3" android:textSize="15dp"/&gt; &lt;EditText android:id="@+id/pwd" android:layout_width="150dp" android:layout_height="25dp" android:inputType="text" android:ems="5" /&gt; &lt;Button android:layout_width="60dp" android:layout_height="35dp" android:text="@string/ref" android:id="@+id/bLogin" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>----Main Activity Code---</p> <pre><code>package com.android.disasterAlertApp; import android.app.Activity; import android.os.Bundle; import android.widget.Button; public class MainActivity extends Activity { /** Called when the activity is first created. */ Button login; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); login =(Button) findViewById(R.id.bLogin); } } ----Manifest---- [2012-04-17 00:34:20 - Disaster Alert App] res\layout\main.xml:0: error: Resource entry main is already defined. [2012-04-17 00:34:20 - Disaster Alert App] res\layout\main.out.xml:0: Originally defined here. [2012-04-17 00:34:20 - Disaster Alert App] C:\Users\Acer\workspace\Disaster Alert App\res\layout\main.out.xml:1: error: Error parsing XML: no element found [2012-04-17 01:05:59 - Disaster Alert App] res\layout\main.xml:0: error: Resource entry main is already defined. [2012-04-17 01:05:59 - Disaster Alert App] res\layout\main.out.xml:0: Originally defined here. [2012-04-17 01:05:59 - Disaster Alert App] C:\Users\Acer\workspace\Disaster Alert App\res\layout\main.out.xml:1: error: Error parsing XML: no element found [2012-04-17 01:11:14 - Disaster Alert App] res\layout\main.xml:0: error: Resource entry main is already defined. [2012-04-17 01:11:14 - Disaster Alert App] res\layout\main.out.xml:0: Originally defined here. [2012-04-17 01:11:14 - Disaster Alert App] C:\Users\Acer\workspace\Disaster Alert App\res\layout\main.out.xml:1: error: Error parsing XML: no element found [2012-04-17 01:14:56 - Disaster Alert App] ------------------------------ [2012-04-17 01:14:56 - Disaster Alert App] Android Launch! [2012-04-17 01:14:56 - Disaster Alert App] Connection with adb was interrupted. [2012-04-17 01:14:56 - Disaster Alert App] 0 attempts have been made to reconnect. [2012-04-17 01:14:56 - Disaster Alert App] You may want to manually restart adb from the Devices view. [2012-04-17 01:17:27 - Disaster Alert App] Error in an XML file: aborting build. [2012-04-17 01:37:10 - Disaster Alert App] res\layout\main.xml:0: error: Resource entry main is already defined. [2012-04-17 01:38:42 - Disaster Alert App] res\layout\main.xml:0: error: Resource entry main is already defined. [2012-04-17 01:38:42 - Disaster Alert App] res\layout\main.out.out.xml:0: Originally defined here. [2012-04-17 01:38:42 - Disaster Alert App] C:\Users\Acer\workspace\Disaster Alert App\res\layout\main.out.out.xml:1: error: Error parsing XML: no element found [2012-04-17 01:39:28 - Disaster Alert App] Error in an XML file: aborting build. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload