29

I'm getting following warning while building the Xamarin Android project.

Warning XA0101: @(Content) build action is not supported (XA0101)

For this topic I found resources below, but I can't figure out the solution to get rid of this warning. Can somebody help me?

http://developer.xamarin.com/guides/android/under_the_hood/build_process/#Content http://developer.xamarin.com/releases/android/xamarin.android_5/xamarin.android_5.1/#Bug_Fixes

Andree
  • 968
  • 1
  • 13
  • 28

3 Answers3

35

It's a warning that came with the new Xamarin Update. If you want to get rid of it, change the Build Action for AndroidManifest.xml to "none".

Markus Dietrich
  • 617
  • 6
  • 18
  • Sure, but this way the manifest will be ignored. Couldn't that be a problem? – Andree May 20 '15 at 06:06
  • No it is not a problem. – Cheesebaron May 20 '15 at 10:03
  • 2
    I concur - the manifest file is included in the APK even if the build action is set to None. You can confirm this by unzipping the generated APK and examining the AndroidManifest.xml file yourself - that, or use something like drozer to inspect the installed package. – Joseph Redfern Jun 04 '15 at 12:57
  • @mdi1984, could you explain where to change the Build Action for AndroidManifest.xml to "none?" I am running into the same issue and can't figure out where to make that change. – Sebbo Aug 06 '15 at 22:55
  • 1
    Nevermind, found it. It's an option under the file properties of the AndroidManifest.xml file. – Sebbo Aug 06 '15 at 23:05
  • For those, who are not aware of how to do that: Go to your AndroidManifest.xml in the Solution Explorer of Visual Studio. Right-Click on the File -> Properties. And set under "Advanced" the "Build Action" to "None" – Lepidopteron Apr 10 '17 at 11:39
2

" New projects created from templates show ignorable build warning: "@(Content) build action is not supported ... AndroidManifest.xml". Workaround: change the build action of "AndroidManifest.xml" to "none". Now fixed in the Alpha and Beta channels. "

-- by Stable release: XamarinVS 3.11.445, new features and bug fixes (Brendan Zagaeski)

Refer : Bug 28210 - Bugzilla

Yksh
  • 3,768
  • 10
  • 51
  • 99
  • Have same error "@(Content) build action is not supported" but for a DLL. This DLL has same Properties as other DLLs in same project References but this is only one complaining. Any ideas? – Riga Feb 01 '16 at 12:03
  • I think you can start a new question explaining your full error : @Riga – Yksh Feb 01 '16 at 12:16
  • Not fixed for me, I just downloaded xamarin from the website –  Feb 05 '16 at 04:26
0

My case was similar but for a slightly different reason. I was using msbuild /t:pack to package my Android package into a NuGet package (NUPKG) and wanted to include some static content in the generated NUPKG.

I had this, which worked in most projects, but not the Android ones:

  <ItemGroup>
    <Content Include="..\THIRD-PARTY-NOTICES.txt" Link="THIRD-PARTY-NOTICES.txt">
      <Pack>true</Pack>
      <PackagePath></PackagePath>
    </Content>
  </ItemGroup>

But based on other answers in this question, I updated <Content ...> to <None ...>:

  <ItemGroup>
    <None Include="..\THIRD-PARTY-NOTICES.txt" Link="THIRD-PARTY-NOTICES.txt">
      <Pack>true</Pack>
      <PackagePath></PackagePath>
    </None>
  </ItemGroup>

And this still works just fine in all my projects (class lib, Android, iOS, others). The txt file got correctly picked up and embedded in the generated NUPKG.

Eilon
  • 25,103
  • 3
  • 82
  • 100