"aapt.exe" exited with code 255 - xamarin

Trying to setup my build server for Xamarin Android builds, but i constantly keeps getting into this issue:
[error]C:\Program Files
(x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1832,3):
Error MSB6006: "aapt.exe" exited with code 255.
Anyone know what this error code means? We dont have this issue on the teams local computers. So i assume i am missing something on the build machine, but cannot figure out what.
Visual Studio Team Services Build Agent
MS 2012 R2 Datacenter
Visual Studio 2015 Community
Android SDK Manager w/all SDK's up til revision 24
Xamarin 6.1.1.0

There must be a problem in build tool. So, can you compare the installed build tool version in your local machine and build machine.
Note: Add the following line under PropertyGroup tag in your project file to specify the build tool version.
<AndroidSdkBuildToolsVersion>23.0.3</AndroidSdkBuildToolsVersion>

I believe you are probably missing some files in your SDK manager for android. Open the sdk manager and ensure you have downloaded all API levels you are targeting as well as the up to date build tools and extras.

Related

Could not find SDK "WindowsMobile, Version=10.0.18362.0" error in VS17 when deploying to HoloLens

I'm new to HoloLens (and Microsoft's ecosystem) and am following this tutorial to learn. One of the steps is to deploy from Visual Studios to HoloLens, but when I try to I get this run-time error.
I have confirmed that I have followed this guide from Microsoft to set up my development environment, but my error still persists.
In Unity, these are by build settings and Player settings as instructed in the tutorial:
My Windows 10 computer is running on 1903, my HoloLens is on 1804, and I have both Windows SDK 10.0.17x and 10.0.18x installed on my computer (via Visual Studios installer and this link). I have also tested deploying the app using the 10.0.17x SDK, but end with the same results.
I can simulate my app from Unity using the Holographic Remoting app in HoloLens, but I just can't deploy it from Visual Studios. What is causing this error and how can I solve it?
Update:
I have tried re-installing the Windows 10 SDK (both 10.0.17x and 10.0.18x), but this did not resolve the problem. My Windows 10 SDK is installed in my D: drive if that would make any difference.
Update 2:
I read somewhere that if you simply delete those files from the project tree in Visual Studios, the error will go away. Indeed it did and I could build and run just fine after that seemly without issue, but there must be something wrong with deleting SDK files like that... Is deleting them safe?
Thank you for your help!
I managed to get this to work by deleting the reference to the Mobile SDK in the vxcproj file. It doesn't seem to be required!
App deployed to Hololens successfully!
According to the error message from the picture you post, there seems to be a problem with your Windows 10 sdk. Please check if the files in this directory are damaged (C:\Program Files (x86)\Windows Kits\10\Extension SDKs\WindowsMobile\10.0.18362.0), and try to reinstall the Windows10 SDK:https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

Visual Studio Release build deploys to Hololens, but Master build doesn't - Activation of Windows Store failed

I am using spectator view for recording and streaming our Hololens app(link) and Visual Studio 2017 to build our solution for the Hololens.
I have been using the following Visual Studio build configurations:
Master, x86.
However, with the same configurations, the project with Spectator View fails with an error:
The program '[5620] SpecTest.exe' has exited with code -1073740966 (0xc000035a).
Activation of the Windows Store app 'SpecTest_s9y1p3hwd5qda!App' failed with error 'The app didn't start'.
We did notice that the app launched when we did a release build with the configuration:
Release, x86.
We require the Master build of the Hololens app because our project uses a Unity Timeline which for some reason doesn't work with the Release build. I searched the internet for this problem and tried almost every solution recommended there (Created a new license, deleted the bin folder and rebuilt the project, tried a Debug build). But, I believe it has something to do with the difference between the Release and Master build. We were previously able to do a master build without this Spectator View bit in our code.
Is there any way to do a Master build and overcome this error?

DEP0600: Deployment failed. XmlException – Data at the root level is invalid

When I deploy a UWP from VS 2017, I’m seeing the following error:
DEP0600: Deployment failed. XmlException - Data at the root level is invalid. Line 24, position 11.
Any clues on how to resolve?
After much debugging and Binging, an SDE pointed out that I was hitting a known bug in Windows 10 Creators Update – which will be fixed in the upcoming Fall Creators update. At install time, all of the installed package are enumerated to see if the package has already been installed. This enumeration fails if the installed app’s AppxManifest.xml file is malformed.
I had several test apps installed on my machine, some deployed with Visual Studio, some installed with PowerShell using the command:
Add-AppxPackage -Register .\PackageLayout\AppxManifest.xml
After uninstalling several of the test apps, I was able to deploy my app with Visual Studio 2017 without problems.

Universal Windows Platform app registration fails - blocked by AppLocker

Deploying a UWP app locally from Visual Studio 2015 (Update 3) fails with the error message:
DEP0700 : Registration of the app failed. error 0xC000003A: Deployment
of package 6dd81a71-9c3a-4204-abaf-886a9b0c29bb_1.0.0.0_x86__kcdnnw7pbsh48 was
blocked by AppLocker. (0x80073cf9)
The full output doesn't add further insight:
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.'
1>------ Build started: Project: App2, Configuration: Debug x86 ------
1> App2 -> c:\users\<username>\documents\visual studio 2015\Projects\App2\App2\bin\x86\Debug\App2.exe
2>------ Deploy started: Project: App2, Configuration: Debug x86 ------
2>Updating the layout...
2>Copying files: Total <1 mb to layout...
2>Checking whether required frameworks are installed...
2>Registering the application to run from layout...
2>DEP0700 : Registration of the app failed. error 0xC000003A: Deployment of package 6dd81a71-9c3a-4204-abaf-886a9b0c29bb_1.0.0.0_x86__kcdnnw7pbsh48 was blocked by AppLocker. (0x80073cf9)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
This has been created as new project via File > New > Project... > Blank App (Universal Windows), with no other changes being made.
Visual Studio is running as Administrator.
Windows 10 (1607 Build 14393) is set up with Developer mode on.
Other suggestions include deleting the app directory from %LocalAppData%\Packages, but there is no directory corresponding to this app.
What could the issue be here? Is there any advice on next steps to troubleshoot this?
Had this same error popping up with Visual Studio 2017 every time I tried to open a XAML file in UWP project. Fixed it by simply creating the folder C:\Windows\System32\AppLocker.
I faced the exact same situation you described last week. It’s taken some time to come back to you as I wanted to go through all the “fix it” options first. I tried all you mentioned and to no avail. You don’t mention it, but I’m guessing you are also using the Pro edition?
I then looked a little more broadly, and found many other users having the same problem installing or updating apps from the Windows store after “upgrading” to the anniversary edition of Windows 10, which you mention you are using. The error code is the same and AppLocker is again the culprit, so it would be worth you testing a new download from the store to see if this is also true for you.
If so, it seems to be because Microsoft has decided to limit some of the useful policy configuration which was previously available in Pro, and now only available in Enterprise or Education. One of the changes that is affecting us is to limit the usage of AppLocker. It’s a real shame and at odds with the push to make a really polished version of Visual Studio and Xamarin (ok – Xamarin is still a little buggy) available on a community license, but then at the same time, changing the OS so that to use the free development tools, you will need an Enterprise license. And normally, the Enterprise edition for Win 10 is only available with a bulk purchase! This blog is a good summary of the changes that have been made in the anniversary edition.
There are two more fixes you could try – run wsreset.exe from a command prompt with admin rights or download this trouble shooter from the MS site. These will try to fix your Windows store configuration, which might also help with UWP deployment. Neither worked for me, but some people online mentioned it worked for them.
So I am facing the tedium of a fresh Windows 10 install – either to go back to the previous version and stop the update to the anniversary edition by tweaking the wifi access… or finding a fresh install of the anniversary edition. I’m going to try the former first as it is one less download, though I’ll still need to download all of the whopping 35gb of Visual Studio and Xamarin again so will wait until I have some spare time!
This worked for me:
Delete all the CI policies here
C:\windows\System32\CodeIntegrity\CiPolicies\Active* (Should be p7b files)
Reboot

Visual Studio Cordova App, can't run debugger - Could not locate the appxrecipe file

If I create a brand new Cordova project (JavaScript or TypeScript) and try to debug on Ripple or on the local machine I get an error during build that says "Could not locate the appxrecipe file."
I googled it and nothing comes up. What is this file and how does it get generated? Shouldn't it be generated when I create the project?
I've already lost an entire day to this, running repairs on visual studio and trying things that had no effect. Frustrating!
This took a while to figure out but it seems that the version of node.js that would get installed with Visual Studio was too old (0.10.x). When I installed the x64 version of node.js from the node website, it installed a 64 bit version which also wouldn't work with Cordova in Visual Studio.
The answer was to install the 32bit version of node.js (node-v5.1.0-x86.msi) available from their website. Now everything compiles correctly!
I was also stucked with the issue but my problem was little bit different. I wanted to build a project for Windows 10 Mobile platform.
It was really weird because everytime when I tried to build a project from CLI with ionic build windows, the build was successul. But it had been throwing the error about appxrecipe file while building with Visual Studio again and again.
Then I noticed that everytime I open a project in Visual Studio (2015, Community Edition) there is one change when you open your confix.xml file in Visual Studio editor - the change was that Windows Target Version was set to 8.1 again. I tried to change it to Windows 10 again, save it and build but the error was still there.
I have solved it with installation of Microsoft Emulator for Windows 10 Mobile and it works like a charm now. Maybe this information could be helpful for somebody...

Resources