I'm able to reproduce this, the issue here is caused by new preview Build-tools (24 rc2). I'm only able to reproduce this issue on Windows, and I can repro from XS, VS and command line:
Diagnostic build output:
Same behavior getting with forms application both on Windows VS and XS.
Build Output for VS: https://gist.githubusercontent.com/Abhishekk360/08a5db2eb442fc372e6355479bc4ec2f/raw/37574cdae85f6ac65c8090b903a8d51c39949904/build%2520output%2520vs
Build Output for XS:
This suggest to make sure to clean up every related products.
If you could reproduce the error even after fresh reinstallation let us know.
After some further investigation, this seems to only happen for me with projects that reference the AppCompat NuGet. @Abhishek can you confirm? Are you still able to reproduce if you use a base template with no NuGets?
If I create the android application with target platforms "modern development" on Windows XS . Then I am successfully able to build and deploy the application on device.
Build Output: https://gist.github.com/Abhishekk360/a5baad2e08cc583274fe804327994862
Application Output: https://gist.github.com/Abhishekk360/7e4a64ae6385b8db0808351b0d3262e7
But If I create android application with target platforms "Maximum Compatibility" then I am getting the reported behavior.
*** Bug 40863 has been marked as a duplicate of this bug. ***
This is still reproducible using Build tools 24 that were released to the main Android SDK Manager "Tools" channel today.
@Atsushi This reproduces on multiple Windows environments with multiple versions of XA. I am able to reproduce this on a clean VM with no VS installed, and on another machine uninstalling Visual Studio and Xamarin and then re-installing Xamarin does not resolve this issue.
Jeremie and I recently spent some time trying to debug this further but we were unable to get any additional error logging out of aapt.
Created attachment 16578 [details]
I believe that this is an aapt bug on Windows.
1. Download Attachment #16578 [details]
2. Unzip it
3. Edit aapt-bug\Makefile and edit the filesystem paths as appropriate for your machine.
4. From CMD.EXE, run `NMAKE`:
> Processing image: res\drawable\icon.png
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Android\android-sdk\build-tools\24.0.0\aapt.exe"' : return code '0xff'
Running on OS X results in no error:
> $ make make AAPT=/opt/android/sdk-tool/sdk/build-tools/24.0.0/aapt \
Additionally, it *appears* to be that `aapt` "doesn't like" the Xamarin/Visual Studio-provided Icon.png template file, which differs from all of the Xamarin Studio Icon.png template files. If I replace `res\drawable\icon.png` with the Xamarin Studio `Resources\drawable-hdpi\Icon.png`, `aapt` executes without error.
Removing the milestone, and will revisit once there's action on the upstream bug.
Filed upstream as https://code.google.com/p/android/issues/detail?id=215209, and appears to be fixed in build tools 24.0.1.
*** Bug 42097 has been marked as a duplicate of this bug. ***