Error creating simple Android App on Windows 8 64bits

I am using Windows 8 64 bits with a fresh Xamarin Studio.

I have created the android example app with the Wizard and, depend on the runtime target I choose, I am getting differents errors:


Target runtime: microsoft .NET

Error:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error MSB4018: Error inesperado en la tarea "Aapt".
System.InvalidOperationException: La secuencia no contiene elementos
en System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
en Xamarin.Android.Tasks.BuildToolsUtils.GetBuildToolsPath(String androidSdkDirectory)
en Xamarin.Android.Tasks.Aapt.GenerateFullPathToTool()
en Microsoft.Build.Utilities.ToolTask.ComputePathToTool()
en Microsoft.Build.Utilities.ToolTask.Execute()
en Xamarin.Android.Tasks.Aapt.Execute()
en Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
en Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() (MSB4018) (AndroidSample)

------------------------------------------------------------------------------------------------------------

Target runtime: Mono 2.10.9

Error:
C:\Users\aacevedo\Documents\Projects\AndroidSample\AndroidSample\AndroidSample.csproj: Error: C:\Users\aacevedo\Documents\Projects\AndroidSample\AndroidSample\AndroidSample.csproj: C:\Program Files (x86)\Mono-2.10.9\lib\mono\xbuild\Novell\Novell.MonoDroid.CSharp.targets: Project file could not be imported, it was being imported by C:\Users\aacevedo\Documents\Projects\AndroidSample\AndroidSample\AndroidSample.csproj: Imported project: "C:\Program Files (x86)\Mono-2.10.9\lib\mono\xbuild\Novell\Novell.MonoDroid.CSharp.targets" does not exist. (AndroidSample)

------------------------------------------------------------------------------------------------------------

Target runtime: Mono 3.0.10

Error:
C:\Users\aacevedo\Documents\Projects\AndroidSample\AndroidSample\AndroidSample.csproj: Error: C:\Users\aacevedo\Documents\Projects\AndroidSample\AndroidSample\AndroidSample.csproj: C:\Users\aacevedo\Documents\Projects\AndroidSample\AndroidSample\AndroidSample.csproj could not import "$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" (AndroidSample)


Any help?

Best Answer

Answers

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    Same here, after the latest Xamarin.Android update:

    Error   1   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() AndroidApplication6
    

    This is in a blank new general Android application project (no code added, nothing modified).

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    This happens in both Visual Studio 2012 and Xamarin Studio

  • AndrewzAndrewz USMember ✭✭
    edited May 2013

    why does it appear as 'ANSWERED'?

    there's no solution posted yet

  • AntonioAcevedoAntonioAcevedo USMember

    I think because is my first time here and I have made a mistake selecting thread type as Answerd instead of thread :S

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    Switching to Beta seems to be a temporary workaround. Building works again now. Have not tried yet what happens when I switch back to Stable again.

    @AntonioAcevedo - have you reported this yet?

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    Reverting to Stable did not help - same issues. Double checked Android SDK Manager packages - all seems fine.
    Switching to Alpha yields:

    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error XA5205: Cannot find `aapt`. Please install the Android SDK Build-tools package with the `C:\Users\Chris\AppData\Local\Android\android-sdk/android` program. (XA5205) (fggfhdgfh)
    
  • StevenTheEvenStevenTheEven SEMember ✭✭✭

    @ChrisHonselaar Isn't the bug you have reported the same as this http://forums.xamarin.com/discussion/comment/13817/ ?

  • AntonioAcevedoAntonioAcevedo USMember

    Perfect Chris and good investigation!

    Is good to know is not a Xamarin error.

    Thank you!

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    @StevenTheEven - it seems to be the opposite of that issue (which I did not find in bugzilla by the way). In this case XS is searching for aapt.exe in 17.0.0/build-tools, not platform-tools.

  • tomasofentomasofen ESMember

    I had the same error, and this is how i get it and how i fix it.

    I had eclipse installed in my computer for Android development. I then install Xamarin. I create a "default" android project, and it worked, deplying it on my Nexus S real device.

    Then i open eclipse to copy some code to adapt to the empty aplication, but when i try to build the sample again (without the canges), it starts to fail, so i suppose that Eclipse did something, and something was mixed between both development tools.

    To fix it, I openned the "Android SDK Manager" (located in my computer in the following route C:\Users\My_windows_user_name_put_here_yours\AppData\Local\Android\android-sdk ), and i install all the things that the tool told me that were outdated. After some minutes intalling things, it finished. I close it and open Xamarin, and it works again.

Sign In or Register to comment.