2

OK, I've looked through the android docs, searched for examples, and read stackoverflow questions like this one: Cannot resolve symbol @drawable/ic_launcher and I still can't figure out what's going on.

I have an ImageButton in my Xamarin Android app that I've defined in my XML file. Here:

    <TextView
        android:layout_width="40sp"
        android:layout_height="wrap_content"
        android:text=""
        android:gravity="center" />
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/increase_quantity_button"
            android:src="@drawable/arrow_drop_up"
            android:contentDescription="@string/increaseQuantity"/>
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/decrease_quantity_button"
            android:src="@drawable/arrow_drop_down"
            android:contentDescription="@string/decreaseQuantity"/>
    </LinearLayout>
    <ImageButton
        android:layout_width="40sp"
        android:layout_height="wrap_content"
        android:id="@+id/delete_item_button"
        android:src="@drawable/delete"
        android:contentDescription="@string/delete"/>

</LinearLayout>
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/item_description"/>

So then I place the files in my drawable folder like this.

enter image description here

Then, when I build the app, I get: This resource URL cannot be resolved

I can't figure out what to try next.

Cfun
  • 8,442
  • 4
  • 30
  • 62
Thom
  • 14,013
  • 25
  • 105
  • 185

1 Answers1

6

Clean your solution, unload your project, reload your project then build it. It's like a bug.

Nima Owji
  • 595
  • 3
  • 13
  • 2
    Duh! I can't believe I didn't think of trying that. Thanks for pointing out the obvious. – Thom Nov 03 '20 at 13:27