Bug 37669 - Run Code Analysis on Solution Input file "obj\Debug\android\AndroidManifest.xml cannot be opened
Summary: Run Code Analysis on Solution Input file "obj\Debug\android\AndroidManifest.x...
Status: RESOLVED DUPLICATE of bug 36183
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: 6.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2016-01-13 22:47 UTC by Jon Douglas [MSFT]
Modified: 2016-01-15 21:14 UTC (History)
4 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description Jon Douglas [MSFT] 2016-01-13 22:47:51 UTC

When running the "Build -> Run Code Analysis on Solution", the build fails as it's trying to find the AndroidManifest.xml, but it isn't created by the time the build fails.

Build Output: https://gist.github.com/JonDouglas/a7b91949d7e772d54bd6

Specific Error:

1>Target "CheckAbiAndMinSDK" in file "C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Analysis.targets" from project "c:\users\jon\documents\visual studio 2015\Projects\App9\App9\App9.fsproj" (target "RunXamarinProjectAnalysis" depends on it):
1>	Using "XmlPeek" task from assembly "Microsoft.Build.Tasks.Core, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>	Task "XmlPeek"
1>		Task Parameter:Namespaces=<Namespace Prefix='android' Uri='http://schemas.android.com/apk/res/android' />
1>		Task Parameter:XmlInputPath=obj\Debug\android\AndroidManifest.xml
1>		Task Parameter:Query=/manifest/uses-sdk/@android:minSdkVersion
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Analysis.targets(43,2): error MSB3733: Input file "obj\Debug\android\AndroidManifest.xml" cannot be opened. Could not find file 'c:\users\jon\documents\visual studio 2015\Projects\App9\App9\obj\Debug\android\AndroidManifest.xml'.
1>		Output Item(s): _MinSdkValue=

This also happens on a Debug/Release configuration of a File->New Blank Android project

*Reproduction Steps:

1. Create a File->New Blank Android Project

2. Rebuild the Project

3. Run Build->Run Code Analysis on Solution

4. The error message above should appear in the output and Build Output.

*Version Information:

Microsoft Visual Studio Professional 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Professional

Visual Basic 2015   00322-40000-00000-AA564
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA564
Microsoft Visual C# 2015

Xamarin (1390b70)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (d300845)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS (ea30b32)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Michael Zimdars 2016-01-14 07:33:47 UTC
This issue can be fixed by commenting out in Xamarin.Analysis.targets:

<Target Name="_EmitXamarinProjectAnalysisResults">
<!--EmitAnalysisResults Results="@(XamarinProjectAnalysisResult)" /-->
<Target Name="_EmitXamarinPackageAnalysisResults">
<!--EmitAnalysisResults Results="@(XamarinPackageAnalysisResult)" /-->

and putting a condition in Xamarin.Android.Analysis.targets:

<Target Name="CheckAbiAndMinSDK" Condition="Exists('$(IntermediateOutputPath)android\AndroidManifest.xml')">

but of course this is disabling analysis tasks in the xamarin build, so this might not be desired.
Comment 2 Mikayla Hutchinson [MSFT] 2016-01-15 21:14:28 UTC

*** This bug has been marked as a duplicate of bug 36183 ***

Note You need to log in before you can comment on or make changes to this bug.