Search code examples
c#androidvisual-studioxamarindesigner

Xamarin.Android - layout designer blank


Today I opened a project to find that none of its layouts will render in the designer.

enter image description here

I am pretty sure it is not an issue with my AXML as the app works fine when built. Visual Studio is up to date (15.9.9) and will display layouts in other projects without issue. My layouts are in the correct location (Resources/layout). I have tried -

  • Cleaning and rebuilding
  • Deleting the bin/obj folders manually and rebuilding the project
  • Turning Accelerated Rendering on/off in Options/Xamarin/Android UI Designer
  • Opening the project in Visual Studio for Mac (7.8) - same issue
  • Restarting Visual Studio/rebooting my computer

Any ideas on how to fix this would be greatly appreciated. I am not sure what part of the source would be useful to help with answering this question so please ask and I will provide.

Note - this project is on TFS.


Solution

  • I found that the issue was caused by the target framework version of the app being set to Android 9.0. Setting this to 8.0 to match the version used by the designer fixed the issue.

    enter image description here

    I need the target framework to be version 9.0 and I can't figure out how to add versions to the designer (8.0 is the only one available to me). I have asked another question in regards to this (see here).