2

I have lots of shared resources (layout, drawable, etc) in my Xamarin.Android projects. I want to have these shared resources in a centralized 'shared project'. (I cannot use Xamarin Library project type for some reason. 'Shared project' is my only choice here). However, the 'Build action' in shared project is limited to the following:

default build actions

Is there any chance to use the 'AndroidResource' build action here?

Fiona Bi
  • 3,140
  • 1
  • 9
  • 5
  • While it is technically possible to manually edit the `.shproj` and include a conditional `ItemGroup` that in turn defines `AndroidResource`, this can (and does) break various build features of Xamarin.Android (and things like the Forms previewer) as native build types are not expected to exist in shared projects. – SushiHangover Aug 06 '19 at 02:01
  • I actually tried manually editing the shproj and adding tags. As soon as Visual Studio opens the project, these resources files are 'excluded' from the project automatically. – Fiona Bi Aug 06 '19 at 20:51
  • Have you resolved your question? – Jessie Zhang -MSFT Aug 20 '19 at 08:10
  • Unfortunately no. I think it needs to be a feature improvement in visual studio. – Fiona Bi Jul 25 '20 at 21:11

1 Answers1

0

Instead of an Android Shared Project, you could use an Android Class Library. That will already include a Resources folder.

Janett Holst
  • 146
  • 1
  • 5
  • 1
    I have to use shared project in order not to deal with the complicated project dependencies of class library. – Fiona Bi Jul 25 '20 at 21:10