4

So im working in Xamarin and i had a problem with my events and layouts because i added new stuff but the layouts didn't refresh they just kept displaying the old layouts and the new events i added had the same problem they are just ignoring my new code i already saw a few links and they said this happens because the Resource.Designer.cs is not refreshing but never gave any solutions any ideas? .

UPDATE: There are no build errors but still the layouts won't refresh.

  • Clear the solution and recompile the solution, it usually solves that problem, also you can delete the obj and bin folders and recompile again everything. – Gusman May 03 '16 at 11:27
  • @Gusman tried it but still the same problem. – The Reptilian Army May 03 '16 at 13:39
  • try to modify something inside the layouts and save them, that will raise the designer recompilation, if the ID's still did not update then check the output logs to see if there is any error when compiling the layouts. – Gusman May 03 '16 at 13:40
  • @Gusman Tried it , even deleted the layout code after that just leaving one button left still shows me the old login layout. – The Reptilian Army May 03 '16 at 13:45
  • Can you check if in the /obj/(configuration)/res/layout of your project your axml files are updated? if they are the new ones I had once this problem and i solved it by uninstalling the APK from the device with adb and then starting debug, it seemed to me the partial update to the apk didn't was aware of the layout changes so it didn't copied them at all. – Gusman May 03 '16 at 13:48

5 Answers5

1

It's happening to me all the time in VS2017, the trick is to re-add "MSBuild:UpdateGeneratedFiles" in the "Custom Tool" property of your layout.

Charles F
  • 114
  • 5
0

Project Clean & rebuild the solution/project normally solves the issue.

Usually this condition is seen if you have build/compile issues with your code, axml, etc.. and thus the generated-code/code-behind file can not be created.

If you can reproduce this issue, I would highly recommend adding to this open issue:

Note: You can also try the current alpha/beta cycle release if you can not currently on that release channel

Community
  • 1
  • 1
SushiHangover
  • 68,368
  • 9
  • 89
  • 150
0

Ok first of all thanks everyone for your help and the problem was only happenign to one of my layouts (Login) the other ones were updating just fine this problem was happening because i imported this layout from another solution i did earlier that had a problem with a .gif file and deleted a few files from that 1º solution i created another layout and its working fine thanks everyone.

0

I'm having the same issue: this is the official Xamarin answer (which isn't particularly great for people unable to update to version 5.0 +):

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

Options:

1) Manually edit your .csproj file (eww)

2) Create a brand new project and copy your resources (disgusting)

3) Update.

I wish I could be more helpful...

Michael Gabay
  • 553
  • 1
  • 8
  • 14
-2

Try to uninstall the existing application from the emulator/device and then clean solution, rebuild and run.

Akash Amin
  • 2,363
  • 17
  • 33