-3

My android project gives this error while I'm trying to build it.I found several solutions which tell me to remove whitespace initially. But unfortunately, I don't have any whitespace. So can you please let me know why my error occurred and possible solution?

My XML is here :

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">

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

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/nav_allplace"
            android:icon="@drawable/ic_all_places"
            android:title="@string/nav_title_all_place" />

        <item
            android:id="@+id/nav_categories"
            android:icon="@drawable/ic_categories"
            android:title="@string/nav_title_categories" />

        <item
            android:id="@+id/nav_map"
            android:icon="@drawable/ic_map"
            android:title="@string/nav_title_map" />

        <item
            android:id="@+id/nav_ar"
            android:icon="@drawable/ic_ar_camera"
            android:title="@string/nav_ar_map" />

    </group>

    <group android:checkableBehavior="none">
        <item android:title="@string/nav_title_my_activities">
            <menu>
                <group android:checkableBehavior="single">
                    <item
                        android:id="@+id/nav_review"
                        android:icon="@drawable/ic_rate_review"
                        android:title="@string/nav_title_rates_and_reviews" />
                    <item
                        android:id="@+id/nav_gallery"
                        android:icon="@drawable/ic_collections"
                        android:title="@string/nav_title_gallery" />
                    <item
                        android:id="@+id/nav_logout"
                        android:icon="@drawable/ic_cancel"
                        android:title="@string/nav_title_sign_out" />
                </group>
            </menu>
        </item>
    </group>

    <group android:checkableBehavior="none">
        <item android:title="@string/setting_test">
            <menu>
                <group android:checkableBehavior="single">
                    <item
                        android:id="@+id/nav_about"
                        android:icon="@drawable/ic_about"
                        android:title="@string/str_about" />
                </group>
            </menu>
        </item>
    </group>


</menu>

Tanvir Durlove
  • 142
  • 1
  • 10
  • refer this link : https://stackoverflow.com/questions/6474741/error-error-parsing-xml-xml-or-text-declaration-not-at-start-of-entity – Ali Feb 27 '18 at 06:43
  • @MohammadAli Why? The problem in that question are the garbage letters at the very start of the document, which is not the problem here. – Yunnosch Feb 27 '18 at 06:43
  • becoz in this link same problem like this question so – Ali Feb 27 '18 at 06:44
  • ?????????????????/ – Ali Feb 27 '18 at 06:46
  • 1
    I will phrase it differently. The answer below seems much more plausibly helpful than your link. The problem in your link is solved by getting rid of the garbage letters at the very start of the document. I consider the answer below (removing what looks like correct XML from later in the document) to plausibly be what will actually help OP. Same error message is not the same as same problem, even less the same as same solution. – Yunnosch Feb 27 '18 at 06:47
  • @MohammadAli Actually 2 of the 3 letters I first considered "garbage" are by accident ("X" for marking the point and the reverse quote probably for bad markdown) but the first one (the space) is the actual problem. So while I was somewhat wrong my statement happens to remain true. Also, OPs explicit statement that solutions by removing white space did not help (OP, my compliment for now obvious research effort, by the way) render your comment noise. – Yunnosch Feb 27 '18 at 07:04

1 Answers1

3

Remove the extra

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

Mike
  • 1,313
  • 12
  • 21