title: Trying to make a ToggleButton with images, getting error: <item> tag requires a 'drawable' attribute or child tag defining a drawable
body: <p>I am trying to follow a simple tutorial online about making a toggle button in android with images (so it shows images instad of ON/OFF).</p>
  <p>It doesn't work. The error I get is</p>
  <pre><code>-        Binary XML file line #1: &lt;item&gt; tag requires a 'drawable' attribute or child tag defining a drawable
  </code></pre>
  <p>I am using Visual Studio 2019 and coding with Xamarin.</p>
  <p>I have a toggle button defined like this in my <strong>activity_main.xml</strong>:</p>
  <pre><code>  &lt;ToggleButton
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:layout_toLeftOf=&quot;@id/toggleButton1&quot;
      android:background=&quot;@drawable/toggleButton_emp&quot;
      android:id=&quot;@+id/toggleButtonEmp&quot;/&gt;
  </code></pre>
  <p>Then I have a &quot;<strong>toggleButton_emp.xml</strong>&quot; file in &quot;Resources\drawable&quot; which contains:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;selector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
    &lt;item android:drawable=&quot;@drawable/faction4&quot; android:state_checked=&quot;true&quot;/&gt;
    &lt;item android:drawable=&quot;@drawable/faction3&quot; android:state_checked=&quot;false&quot; /&gt;
  &lt;/selector&gt;
  </code></pre>
  <p>faction4 and faction3 are valid drawables I have added to &quot;Resources\drawable&quot;</p>
  <p>I have found many answers for this issue that are most 10 years old, and none help. They often say to make &quot;drawable&quot; first tag but it's already first. Or removing spaces but I don't have any.</p>