Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resource.designer.cs Not Updating

Computer Specification

  • Visual Studio 2015 Enterprise Update 3
  • Xamarin 4.2.0.719
  • Xamarin.Android 7.0.1.6
  • Xamarin.iOS 10.2.0.4

Problem Details

Resource.designer.cs Not Updating in Xamarin.Droid project.

  1. Tried to delete
  2. Tried to Clean content and rebuild
  3. Restart Solution
  4. Restart Computer
  5. Create new Project.
  6. Re-add files as Android Resource
  7. Tried to delete the Resources.Designer.cs file

I tried all of the posts below that i might think this is a duplicate post:

  • Resource.designer.cs NOT regenerating in Mono (Xamarin Studio)

  • Adding new strings to resource.resx not reflecting into Designer.cs

  • Xamarin Resource.Designer.cs not refreshing new id's or events

  • Xamarin Android - How to rebuild Resource.designer.cs

  • Resource.designer.cs NOT regenerating in Mono (Xamarin Studio)
  • Resource.Designer.cs: "Resource ... does not contain a definition for ..."
  • Hundreds of Resource.Designer.cs build errors on latest Xamarin Forms 2.2.0.45
  • Xamarin Resource.designer.cs not generating reference for newly add file
  • Xamarin.Droid: Resource.Designer.cs broken after update
  • Why is Resource.Designer.cs not created

Also tried official link from Xamarin:

  • https://developer.xamarin.com/guides/android/troubleshooting/questions/resource-designer-wont-update/

I tried this one from Codeproject where it says [Solved] But also didn't work for myself:

  • http://www.codeproject.com/Questions/227676/Resource-file-regenerating
like image 793
Anderson Oki Avatar asked Nov 02 '16 04:11

Anderson Oki


1 Answers

I had a similar problem where there was an error in a resource file which prevented the resource.designer.cs file from updating. In my case the issue was that I had added a few images which had illegal characters in their file names.

However what is important is how to discover your specific issue because the errors from the Android Asset and Packaging Tool do not show up in the Error List tab in Visual Studio. I had to set the build output verbosity to diagnostic and then search for Task "Aapt". After locating the aapt section, I found the information that allowed me to locate and fix my error at the bottom of the section. I've included it the section of the log:

Executing package -f -m -M C:\Users\billm\AppData\Local\Temp\2xfnjt4r.kaj\manifest\AndroidManifest.xml -J C:\Users\billm\AppData\Local\Temp\2xfnjt4r.kaj ...    
    res\drawable\keyboard-backspace-long.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113)
    res\drawable\keyboard-backspace-long.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113)
    res\drawable\keyboard-backspace-xlong.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113)
    res\drawable\keyboard-backspace-xlong.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113)
    res\drawable\keyboard-backspace.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113)
    res\drawable\keyboard-button.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113)
    Done executing task "Aapt". (TaskId:113)
like image 55
bmacadam Avatar answered Nov 13 '22 19:11

bmacadam