Bug 12802 - Cannot build android projects
Summary: Cannot build android projects
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.6.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2013-06-20 19:35 UTC by Jake Hall
Modified: 2013-06-20 21:36 UTC (History)
2 users (show)

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


Attachments
my xamarin.android.common.targets file (65.06 KB, text/plain)
2013-06-20 19:35 UTC, Jake Hall
Details


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 INVALID

Description Jake Hall 2013-06-20 19:35:49 UTC
Created attachment 4172 [details]
my xamarin.android.common.targets file

Description of Problem:
I cannot currently build any android project -- see error 

This happens in debug or release mode for me.

Steps to reproduce the problem:
1. Build android app


Actual Results:
Error:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error MSB4018: The "Aapt" task failed unexpectedly.

System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Xamarin.Android.Tasks.BuildToolsUtils.GetBuildToolsPath(String androidSdkDirectory)
   at Xamarin.Android.Tasks.Aapt.GenerateFullPathToTool()
   at Microsoft.Build.Utilities.ToolTask.ComputePathToTool()
   at Microsoft.Build.Utilities.ToolTask.Execute()
   at Xamarin.Android.Tasks.Aapt.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() (MSB4018) (AirGuest.Common.Android)

Expected Results:
Android build completes.

How often does this happen? 
Every time

Additional Information:
I've tried uninstalling the xamarin studio and xamarin.android and reinstalling but no love.  Clicking on the error drives me to the file:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets

And highlights line 610 (copied below).  I've also attached this file.

	<!-- Run aapt to generate R.java -->
	<Aapt
		AndroidSdkDirectory="$(_AndroidSdkDirectory)"
		JavaPlatformJarPath="$(JavaPlatformJarPath)"
		ManifestFile="$(ResgenTemporaryDirectory)\AndroidManifest.xml"
		PackageName="$(_AndroidPackage)"
		ResourceDirectory="$(MonoAndroidResDirIntermediate)"
		JavaDesignerOutputDirectory="$(ResgenTemporaryDirectory)"
		ResourceOutputFile="$(ResgenTemporaryDirectory)\resources.apk"
		ExtraPackages="$(AaptExtraPackages)"
		AdditionalResourceDirectories="$(LibraryResourceDirectories)"
		LibraryProjectJarsWildcard="$(IntermediateOutputPath)__library_projects__\*.jar"
		ExtraArgs="$(AndroidResgenExtraArgs)"
	/>
Comment 1 Jonathan Pryor 2013-06-20 21:36:24 UTC
You have a %ANDROID_SDK_PATH%\build-tools directory, but there is nothing inside of it. Please install the Android SDK Build-tools package within within Android SDK Manager (%ANDRDOID_SDK_PATH%\tools\android.bat program).