Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Description of Problem:
Resource ids are not always updated when renaming the file
Steps to reproduce the problem:
1. Create new Android app (Honeycomb)
2. Open Main.axml in designer view
3. Select Button, open Resource view for Background and choose Icon
4. Save Main.axml
5. Rename Icon.png in Solution explorer to my_icon.png.
5. The new name is not update in Resource.designer.cs
6. Restart the Studio - the name is not update still
7. Remove @drawable/Icon as background from the button.
8. The new name is updated in Resource.designer.cs and appears to be my_icon now
9. Rename my_icon.png in Solution explorer to my__new_icon.png.
10. Check Resource.designer.cs - new name appears there right away
11. Open Resources view to set background for the button.
12. The id is not updated there - still is my_icon
13. Cleaning the project or refreshing folders in Solution explorer does not help
14. Restarting the solution fixes the issue.
The id should be updated right away. Bonus result: the ids should be updated in all places, even when they are assigned to some control (for example, in describe case - as background of the button)
How often does this happen?
I'm pretty sure this is due to recent changes in aapt causing it to validate that there are no references to missing resources. This means that the Resource.designer.cs will not updated until all files that refer to the renamed/removed resource have also been updated.
See e.g. http://forums.xamarin.com/discussion/comment/43614/#Comment_43614
One possible solution would be https://bugzilla.xamarin.com/show_bug.cgi?id=5870#c14
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.