Home > Software design >  XML document structures must start and end within the same entity in .xml
XML document structures must start and end within the same entity in .xml

Time:03-12

I received this problem in making a chatting application!

When I click on build gradle in android studio, I get the following error :-

ParseError at [row,col]:[6,115] Message: XML document structures must start and end within the same entity.

My manifest.xml :-

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

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" ></uses-permission>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" ></uses-permission>
    <uses-permission android:name="android.permission.INTERNET" ></uses-permission>

    <application
        android:allowBackup="true"
        android:fullBackupContent='true'
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.Messenger">
        <activity android:name="com.dccodes.chugli.StartActivity" android:windowSoftInputMode="stateAlwaysHidden">


        </activity>

        <activity android:name="com.dccodes.chugli.RegisterActivity" android:windowSoftInputMode="stateAlwaysHidden" android:parentActivityName="com.dccodes.chugli.StartActivity"/>

        <activity android:name="com.dccodes.chugli.MainActivity"/>

        <activity android:name="com.dccodes.chugli.LoginActivity" android:windowSoftInputMode="stateAlwaysHidden" android:parentActivityName="com.dccodes.chugli.StartActivity"
            android:exported="true">
            <intent-filter>

                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>

            </intent-filter>
        </activity>

        <activity android:name="com.dccodes.chugli.MessageActivity"/>

        <activity android:name="com.dccodes.chugli.ResetPasswordActivity" android:windowSoftInputMode="stateAlwaysHidden" android:parentActivityName="com.dccodes.chugli.LoginActivity"/>


        <service android:name="com.dccodes.chugli.Notifications.MyFirebaseIdService" android:exported="false" android:enabled="true"
            tools:ignore="Instantiatable">


            <intent-filter>

                <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>

            </intent-filter>

        </service>


        <service android:name="com.dccodes.chugli.Notifications.MyFirebaseMessaging" android:exported="false" android:enabled="true">


            <intent-filter>

                <action android:name="com.google.firebase.MESSAGING_EVENT"/>

            </intent-filter>

        </service>
        <!-- FirebaseInstanceIdService performs security checks at runtime,
      no need for explicit permissions despite exported="true"             -->

    </application>

</manifest>

I have updated my studio to the latest version, I have reinstalled also. But, there is no solution to this problem.

I can't solve this problem, Can anyone tell where is the problem..?

Can anyone help me...?

CodePudding user response:

try using ctrl alt L this would correctly indent and rearrange your code to look easy to read.

If you see any odd behaviour in the indentation (like a tag was supposed to have one tab space but has two tab spaces on the left) then that means there is an unclosed tab somewhere near that area.

This might help you in searching though all the more than 15 layout files you have.

Once you find the unclosed tag, you know what to do.


although this is one way, you can always look at the top right of the active tab for errors, warnings, suggestions. A sample -

error sample

once you see an error code, click on it. then double click on the error from the bottom tab. that would bring you to the line where the error is found. eg -

error display

  • Related