"Tag start is not closed" when commenting inside XML element's start and end tag

11,615

Comments are not allowed inside tags. You have to close the tag first with ">" or "/>" and then you can add your comment there.

Share:
11,615
user3801167
Author by

user3801167

Updated on July 13, 2022

Comments

  • user3801167
    user3801167 almost 2 years

    <!-- Comment --> is the way to add comments in an XML file. Doesn't that actually means, that this part is not "compiled"?

    However, when I do something like this:

    <item android:id="@+id/ss3"
        android:icon="@drawable/some_icon"
        android:title="Blabla Title"
        tools:ignore="AppCompatResource"
        <!-- -->
    />
    

    I get an error "Tag start is not closed". Why?