Error executing task BuildApk: packaged_resources does not exist

Have you ever encountered an error: Error executing task BuildApk: .../bin/packaged_resources does not exist? If so you probably know that solving this issue can be sometimes quite tricky. It may be hard to track when and where the true bug was introduced in the code base. Although some suggestions can be found on the Xamarin Forum the solution usually differ case by case.

The initial error may look like this:


/.../MyApp.csproj (SignAndroidPackage) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_BuildApkEmbed target) ->

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: error : Error executing task BuildApk: obj/Debug/android/bin/packaged_resources does not exist

It doesn’t tell to much. The true issue is usually related not with the BuildApk task itself but with the previous one - generating the app package resources with AAPT tool.

To track down the true error first turn on the detailed build logs. Here is a great instruction how to do this step by step and where to find the log output.

Next step is to find the error in the detailed log. Look for the error APT string. Here is an example:


Executing package -f -m -M obj/Debug/android/manifest/AndroidManifest.xml -J /var/folders/ls/dtrrhlz12qb0cqwvqhs008b80000gn/T/zct7dmic.ctk --custom-package -F obj/Debug/android/bin/packaged_resources.bk -S obj/Debug/res/ -S
Resources/layout/RoomDetailView.axml(2): error APT0000: No resource identifier found for attribute 'compatElevation' in package ''
Done executing task "Aapt"

In my case the error was caused by wrongly defined axml attribute local:compatElevation:

	                    local:MvxBind="Click BookRoomCommand; Visibility RoomInfo, Converter=BookButtonVisibility"

Like I wrote before - it’s usually different in each case but now you know how to check what is the issue with your app.

Happy coding!

Marek Mierzwa

Marek Mierzwa
Husband, father, spiritual journeyman and in the meantime a software developer

Object reference not set in Xamarin.Forms XAML compilation

XAML compilation is (or at least should be) one of the default optimisation steps in Xamarin.Forms app development. It really speeds up t...… Continue reading

Mocking HTTP response in Simple.OData client

Published on August 22, 2017

Placeholder text in Xamarin.Forms Editor

Published on July 29, 2017