Android on Xamarin.forms - Unable to find existing resources

RichardCurteisRichardCurteis USMember
edited February 2016 in Xamarin.Android

Duplicating this from a post I made on SO.
I have been developing a Xamarin.Forms app, initially on iOS and now for Android. I have run into a problem whereby my code is unable to see the resources being referenced in my MainActivity.cs., even though they exist in the correct place.

https://stackoverflow.com/questions/35258720/android-on-xamarin-unable-to-find-existing-resources

Answers

  • GeraldVersluisGeraldVersluis NLUniversity ✭✭✭✭

    Think this is more a Android subforum question :wink:

    Note really a Android expert myself but don't you have to add a android:id to the root as well?
    Like this.

    <?xml version="1.0" encoding="UTF-8" ?>
    
    <menu xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/menu">
          <item 
            android:id="@+id/action_add"
            android:icon="@drawable/addIcon"
            android:title="Add"
            app:showAsAction="always"
            />
    </menu>
    
  • RichardCurteisRichardCurteis USMember
    edited February 2016

    Yeah I wasn't sure what the etiquette is for cross platform apps sorry.
    No I tried adding that in but I still get the same error.

    Moved to Android sub-forum

  • RichardCurteisRichardCurteis USMember
    edited February 2016

    Figured it out.
    See this Xamarin forums post and I put the solution in my Stack Overflow post above.

Sign In or Register to comment.