locked
Resource.String does not contain a definition for Hello ?!?! RRS feed

  • Question

  • User2157 posted

    I've got a fairly simple Android project which continuously keeps adding the following to resource.designer.cs;

    global::MYNAMESPACE.Resource.String.ApplicationName = global::BabyBio.Android.Resource.String.ApplicationName; global:: MYNAMESPACE.Resource.String.Hello = global::BabyBio.Android.Resource.String.Hello;

    And it won't go away! I think these originated from the default .axml file created with the project, but there's no reference to those objects now. I've had to resort to adding;

    <string name="ApplicationName">ApplicationName</string> <!-- here to keep the resource.designer.cs from borking! --> <string name="Hello">Hello</string>

    into strings.xml just to keep it from erroring, I get that designer.cs is generated, but where from, I've seen references to the forums to downgrade Xamarin.Android but that was > 1 year ago, has something been re-introduced?

    Wednesday, June 4, 2014 7:43 AM

Answers

  • User138545 posted

    I had the same issue too, especially when upgrading from FormsApplicationActivity *to *FormsAppCompatActivity. Clean all and rebuild all resolved it for me.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, October 31, 2015 4:35 AM

All replies

  • User21936 posted

    Often a clean and rebuild will resolve this type of error.

    Another thing to check is that the Default Namespace in your Project Properties for the Android project matches the namespace you are actually using for that project.

    Friday, January 16, 2015 12:20 AM
  • User138545 posted

    I had the same issue too, especially when upgrading from FormsApplicationActivity *to *FormsAppCompatActivity. Clean all and rebuild all resolved it for me.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, October 31, 2015 4:35 AM
  • User67586 posted

    Same here. The "Clean" also worked for me. Thank's Jon! Btw: before I did a Clean/Rebuild, my string resources and drawables had been mixed up... i mean, in the UI i saw the wrong Images and strings!? Very strange...

    Thursday, March 10, 2016 8:08 AM
  • User281342 posted

    To solve my problem I had to create a String.xml inside the "Resourse => values" directory with this code, I had tried out the "values" directory but it did not work:

    <?xml version="1.0" encoding="utf-8" ?> <resources> <string name="ApplicationName">ApplicationName</string> <string name="Hello">Hello</string> </resources>

    Saturday, December 24, 2016 10:06 PM
  • User176749 posted

    clean and rebuild adds these 2 lines again. but why do we even need them?

    Wednesday, February 1, 2017 2:45 AM