7 Replies - 291 Views - Last Post: 14 May 2019 - 04:28 PM

#1 awthz   User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 76
  • Joined: 13-February 17

Run build failed.

Posted 14 May 2019 - 01:14 AM

Hi guys, im new to andriod development and would like to ask your help about this error. I've tried to search for the answer in google however couldnt find the solution.

Everytime I run the file, I end up having error in the manifest.xml and this is the code.

On line number 8 indicates a red line.
this is also the message that reflect in the error in the console.

C:\Users\Mom's Spaghetti\AndroidStudioProjects\MyFirstApplication2\app\src\main\res\values\strings.xml:2:56: Error: XML document structures must start and end within the same entity.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myfirstapplication">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".StudentRegistration"></activity>
        <activity
            android:name=".LoginStudent"
            android:parentActivityName=".MainActivity" />
        <activity
            android:name=".LoginTeacher"
            android:parentActivityName=".MainActivity" />
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>



Looking forward for your help.
Cheers

Is This A Good Question/Topic? 0
  • +

Replies To: Run build failed.

#2 wseng92   User is offline

  • D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 700
  • Joined: 23-September 15

Re: Run build failed.

Posted 14 May 2019 - 01:33 AM

Quote

C:\Users\Mom's Spaghetti\AndroidStudioProjects\MyFirstApplication2\app\src\main\res\values\strings.xml:2:56:

The error is coming from strings.xml. Can you post your strings.xml layout?

This post has been edited by wseng92: 14 May 2019 - 01:34 AM

Was This Post Helpful? 0
  • +
  • -

#3 awthz   User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 76
  • Joined: 13-February 17

Re: Run build failed.

Posted 14 May 2019 - 04:14 AM

this is the string file.. did i do something wrong or accidentally decode it?

<component name="libraryTable">
    <library name="Gradle: com.android.support:interpol

Was This Post Helpful? 0
  • +
  • -

#4 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6818
  • View blog
  • Posts: 28,228
  • Joined: 12-December 12

Re: Run build failed.

Posted 14 May 2019 - 05:02 AM

There seems a lot removed from that file, it is incomplete.
Was This Post Helpful? 0
  • +
  • -

#5 DarenR   User is offline

  • D.I.C Lover

Reputation: 634
  • View blog
  • Posts: 4,209
  • Joined: 12-January 10

Re: Run build failed.

Posted 14 May 2019 - 06:21 AM

you seem to be missing > at the end of your file unless you didnt post the entire thing for us
Was This Post Helpful? 0
  • +
  • -

#6 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2940
  • View blog
  • Posts: 11,416
  • Joined: 03-December 12

Re: Run build failed.

Posted 14 May 2019 - 07:09 AM

Quote

Error: XML document structures must start and end within the same entity.


It means that if the document starts with,

<Start>

it must have a corresponding

</Start>

Which yours apparently doesn't have.

Quote

<component name="libraryTable">
    <library name="Gradle: com.android.support:interpol


Not only does that not have a closing tag, it doesn't close the first node either.
Was This Post Helpful? 0
  • +
  • -

#7 awthz   User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 76
  • Joined: 13-February 17

Re: Run build failed.

Posted 14 May 2019 - 02:11 PM

Hi guys, I think I fix it with this code.
<resources>
    <string name="app_name">My First Application</string>
</resources>

I build another file and check what is inside the string.xml and then copy the file and change the name of the app, however, it leads me to another error which is this..

Android resource compilation failed
C:\Users\Mom's Spaghetti\AndroidStudioProjects\MyFirstApplication2\app\src\main\res\layout\activity_login_student.xml:7: error: duplicate attribute.
C:\Users\Mom's Spaghetti\AndroidStudioProjects\MyFirstApplication2\app\src\main\res\layout\activity_login_student.xml: error: file failed to compile.
Was This Post Helpful? 0
  • +
  • -

#8 Sheepings   User is offline

  • D.I.C Lover
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,260
  • Joined: 05-December 13

Re: Run build failed.

Posted 14 May 2019 - 04:28 PM

Make sure that you do not add duplicate attributes. Look at the contents of your file for attributes with the same name.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1