android drawable invalid start tag

16,119

Solution 1

Found a solution, I created the xml file by using a simple text editor (notepad++) and saved it to /res/drawable and compiled, result: it worked like a charm :)

Solution 2

Ideal solution should be to put the XML file in

/res/xml

Solution 3

i have came across the same error and than solved, i did mistake of adding the xml file under values folder so it was not able to recognise selector tag. i removed it from values folder and added inside the drawable folder and it worked without any error. this was in case of Xamarin.Android.

Solution 4

You can right click on the directory you want to create the XML file, selecect Android xml file, and then edit that file. This solved my issue.

Share:
16,119
Houssem
Author by

Houssem

Updated on June 04, 2022

Comments

  • Houssem
    Houssem almost 2 years

    I'm trying to set a tabhost selector, as i found an example demonstrating that i should create an xml file in drawable like this :

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/hotel_selected"
          android:state_selected="true" />
    <item android:drawable="@drawable/hotel" />
    </selector>
    

    but when compiling, eclipse keep saying that it's an invalid start tag in this file.

    please help me solve this.

    many thanks.

  • Steven Combs
    Steven Combs about 12 years
    This was a solution for me with the <shape> xml file.
  • Onimusha
    Onimusha over 8 years
    Solution worked perfectly for <style> xml file if for any reason you want it in that folder