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
URL:
Depends on:
Blocks:
 
Reported: 2016-01-13 22:47 UTC by Jon Douglas [MSFT]
Modified: 2016-01-15 21:14 UTC (History)
4 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 36183

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

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=14.0.0.0, 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   4.0.0.1717 (1390b70)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

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

Xamarin.iOS   9.3.99.33 (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>
<Target Name="_EmitXamarinPackageAnalysisResults">
<!--EmitAnalysisResults Results="@(XamarinPackageAnalysisResult)" /-->
</Target>

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 ***