XML parsing error: element not found

First of all, forgive me if I posted this question incorrectly. I used stackoverflow for many problems, but this is the first time that I could no longer find the answer to my problem. So, if I have something wrong, let me know and I will post / edit the question.

Now to the point. I just started development with the Android SDK recently and I am following the basic tutorial from http://developer.android.com/resources/tutorials/hello-world.html#avd I got the xml editing part and when I do all the changes in xml files main.xml and strings.xml, this error occurs. In addition, when I compile the project, the compilation process creates a main.out.xml file that is empty. I do not know what it is or its purpose.

Mistake:

[2011-12-30 16:10:02 - Hello Razor] res \ layout \ main.xml: 0: error: the resource master record is already defined. [2011-12-30 16:10:02 - Hello Razor] res \ layout \ main.out.xml: 0: Originally defined here. [2011-12-30 16:10:02 - Hello Razor] C: \ Users \ Dux69 \ workspace \ Hello Razor \ res \ layout \ main.out.xml: 1: error: XML parsing error: element not found [ 2011-12-30 16:10:13 - Hello Razor] Error in the XML file: aborting build.

My project is configured for the platform: Android 2.3.3 API level: 10

I don’t know if it matters or not, but I use my Android Incredible to run / debug the application, not the Android Virtual Device. If you need more information, let me know and I will send it as soon as possible.

Here are three code files that I use:

main.xml

<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/textview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:text="@string/hello_O" /> 

strings.xml

 <?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello_O">Baba in the house, Razor Activity!</string> <string name="app_name">Hello Razor App</string> </resources> 

razorActivity.java

 package hello.Razor; import android.R; import android.app.Activity; import android.os.Bundle; public class razorActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } 
+8
android eclipse xml
source share
3 answers

delete main.out.xml in the project view and run it as an android application.

+4
source share

I had a similar problem.

Reconstructing / cleaning the project and restarting Eclipse helped me.

+1
source share

The error message I received is:

 Error:(43) Error parsing XML: no element found 

and

 Error:Execution failed for task ':app:processDebugResources'. 

com.android.ide.common.process.ProcessException: Failed to execute aapt command

Decision. In my case, the activity_main.xml project starts with code

 <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.batvibes.battybirthday.Main1Activity"> 

and I forgot the bottom end tag.

 </android.support.constraint.ConstraintLayout> 

Disclaimer: I am completely unfamiliar with the development of Android. My suggestion, please check all opening and closing tags and proceed to the next stage of debugging.

+1
source share

All Articles