'The "Aapt" task failed unexpectedly' error when building Xamarin Forms application

Hi, i get the following error when i try to compile my Cross-Platform Xamarin Forms app in VS2017 Community. I'm using Windows 10 with all the current updates. Here's my output:
Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
NU1605: Detected package downgrade: Xamarin.Forms from 2.4.0.38779 to 2.4.0.280. Reference the package directly from the project to select a different version.
LetsLend.UWP -> LetsLend.Core -> Xamarin.Forms (>= 2.4.0.38779)
LetsLend.UWP -> Xamarin.Forms (>= 2.4.0.280)
1>------ Build started: Project: LetsLend.Core, Configuration: Debug Any CPU ------
1>LetsLend.Core -> C:\Projects\LetsLend\Shared Code\LetsLend.Core\bin\Debug\netstandard2.0\LetsLend.Core.dll
2>------ Build started: Project: LetsLend.Android, Configuration: Debug Any CPU ------
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: The "Aapt" task failed unexpectedly.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: The specified executable is not a valid application for this OS platform.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Diagnostics.Process.Start()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at Xamarin.Android.Tasks.Aapt.RunAapt(String commandLine)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at Xamarin.Android.Tasks.Aapt.ExecuteForAbi(String cmd, String currentResourceOutputFile)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at Xamarin.Android.Tasks.Aapt.DoExecute(ITaskItem manifestFile, ParallelLoopState state, Int32 loop)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Parallel.<>c__DisplayClass30_02.<ForEachWorker>b__3(Int32 i, ParallelLoopState state, TLocal local) 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Parallel.<>c__DisplayClass17_01.b__1()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Task.InnerInvoke()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: --- End of inner exception stack trace ---
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Task.Wait()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](TSource[] array, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Parallel.ForEach[TSource,TLocal](IEnumerable1 source, Func1 localInit, Func4 body, Action1 localFinally)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at Xamarin.Android.Tasks.Aapt.Execute()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: ---> (Inner Exception #0) System.ComponentModel.Win32Exception (0x80004005): The specified executable is not a valid application for this OS platform.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Diagnostics.Process.Start()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at Xamarin.Android.Tasks.Aapt.RunAapt(String commandLine)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at Xamarin.Android.Tasks.Aapt.ExecuteForAbi(String cmd, String currentResourceOutputFile)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at Xamarin.Android.Tasks.Aapt.DoExecute(ITaskItem manifestFile, ParallelLoopState state, Int32 loop)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Parallel.<>c__DisplayClass30_02.<ForEachWorker>b__3(Int32 i, ParallelLoopState state, TLocal local) 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Parallel.<>c__DisplayClass17_01.b__1()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Task.InnerInvoke()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018: at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )<--- 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1298,2): error MSB4018:
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Sign In or Register to comment.