Bug 41797 - Error: Tool exited with code: 2. Output: ERROR: Unknown option '--no-version-vectors'
Summary: Error: Tool exited with code: 2. Output: ERROR: Unknown option '--no-version-...
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2016-06-14 12:57 UTC by Lars Bøggild
Modified: 2016-10-29 11:22 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
builds before and after forms packet upgrade (86.61 KB, application/zip)
2016-06-14 12:57 UTC, Lars Bøggild
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Lars Bøggild 2016-06-14 12:57:32 UTC
Created attachment 16314 [details]
builds before and after forms packet upgrade

Updating a FOMRS project from forms v2.1.0.6529 to v2.2.0.45 causes all ANDROID builds to fail.

I have attach a file with the error give.
Further I have attached the build with forms v 2.1.0.6529 - showing the working build,
and a build after the packet update to form 2.2.0.45 - that fails.

I have also attached the packet.config file (in both version) so you can see what might cause the '--no-version-vectors' to be added to the AAPT tools - and thus thereby the error.

Brgds lars
Comment 1 Jonathan Pryor 2016-06-15 01:42:10 UTC
The `--no-version-vectors` value is present because something is setting the `$(AndroidResgenExtraArgs)` MSBuild property, which contains a list of additional parameters that are appended to the `aapt` command line.

https://developer.xamarin.com/guides/android/under_the_hood/build_process/#Resource_Properties

What I don't know is what would be setting `$(AndroidResgenExtraArgs)`. Nothing within the Xamarin.Android build process sets that property; we only consume it.

This is where a repro would be handy. :-)

A quick (wrong?) search of all Xamarin github repo's *suggests* that `Xamarin.Android.Support.Vector.Drawable.targets` may be setting that property. Does your project by any chance include that file?

Indeed, the NuGet package contains that .targets file and also overrides $(AndroidResgenExtraArgs): https://www.nuget.org/packages/Xamarin.Android.Support.Vector.Drawable/23.3.0

*Why* it does that, I don't know.

I would suggest, however, that perhaps you should update your Android SDK Build-tools version? `aapt` from Build-tools 23.0.0 supports `aapt --no-version-vectors`.
Comment 2 Guillaume 2016-07-04 15:39:18 UTC
`--no-version-vectors` is probably related to http://android-developers.blogspot.ca/2016/02/android-support-library-232.html
Comment 3 Shawn 2016-10-29 11:22:23 UTC
I am not sure I understand why this issue is marked as "resolved". I have a rather simple NUnit test project that contains only Xamarin Forms, Xamarin Forms Maps, and my business logic.  Every since I updated to the latest version of Xamarin Forms (2.3.2.127) I am now getting this error.  The only workaround that I have found is to manually edit the Xamarin.Android.Support.Vector.Drawable.targets file and remove the "Extra" option.  The problem is, I need to do that EVERY TIME I do a clean all and restore of my packages and on top of that I can no longer use a build server as the package that is downloaded doesn't have this manual fix.  So from what I can see this issue still exists and is a pretty significant blocker for those of us working with Android Development.