The "Aapt" task failed unexpectedly.

Alan911Alan911 USMember

Hi everyone,
i am new to Xamarin but i have an error that i don't know how to solve, any ideas?

Severity Code Description Project File Line Suppression State
Error The "Aapt" task failed unexpectedly.
System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Could not find file 'obj\Debug\android\bin\packaged_resources.bk'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
at Xamarin.Android.Tools.Files.CopyIfZipChanged(String source, String destination)
at Xamarin.Android.Tasks.Aapt.ExecuteForAbi(String cmd, String currentResourceOutputFile)
at Xamarin.Android.Tasks.Aapt.DoExecute(ITaskItem manifestFile, ParallelLoopState state, Int32 loop)
at System.Threading.Tasks.Parallel.<>c__DisplayClass30_02.<ForEachWorker>b__3(Int32 i, ParallelLoopState state, TLocal local) at System.Threading.Tasks.Parallel.<>c__DisplayClass17_01.b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) 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)
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)
at System.Threading.Tasks.Parallel.ForEach[TSource,TLocal](IEnumerable1 source, Func1 localInit, Func4 body, Action1 localFinally)
at Xamarin.Android.Tasks.Aapt.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
---> (Inner Exception #0) System.IO.FileNotFoundException: Could not find file 'obj\Debug\android\bin\packaged_resources.bk'.
File name: 'obj\Debug\android\bin\packaged_resources.bk'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
at Xamarin.Android.Tools.Files.CopyIfZipChanged(String source, String destination)
at Xamarin.Android.Tasks.Aapt.ExecuteForAbi(String cmd, String currentResourceOutputFile)
at Xamarin.Android.Tasks.Aapt.DoExecute(ITaskItem manifestFile, ParallelLoopState state, Int32 loop)
at System.Threading.Tasks.Parallel.<>c__DisplayClass30_02.<ForEachWorker>b__3(Int32 i, ParallelLoopState state, TLocal local) at System.Threading.Tasks.Parallel.<>c__DisplayClass17_01.b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )<--- Test.Android

Answers

  • Dennis.9840Dennis.9840 USMember

    I face the same issue. I use VS2017 Community 15.5.2 and NetStandard 2.0. Did you resolve your problem yet?

  • Alan911Alan911 USMember

    no i did not, i redid my project and this error has gone. i have a new ones but not as bad.

  • AtaTrkogluAtaTrkoglu USMember

    Go to android project Properties and check in Version number whether you have any given Decimal number like 2.0 you should change it to integer 2(btw i saw this answer in another post,this is DarshanJS's answer)

  • DanielRobbinsDanielRobbins USMember ✭✭

    This worked for me! Thanks.

Sign In or Register to comment.