Bug 42511 - Bad argument passed to aapt.
Summary: Bad argument passed to aapt.
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 6.0.99
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jon Dick
Depends on:
Reported: 2016-07-13 11:46 UTC by Martin Nygren
Modified: 2017-08-23 20:49 UTC (History)
3 users (show)

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

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:

Description Martin Nygren 2016-07-13 11:46:40 UTC
In Xamarin.Android.Support.Vector.Drawable.targets the argument --no-version-vectors is added like this:

</Project>[Martin-Macbook-Work:packages/Xamarin.Android.Support.Vector.Drawable.23.3.0/build] martin% cat Xamarin.Android.Support.Vector.Drawable.targets~ 
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <!-- Adds an argument to the call to aapt to support vectors -->

    * Xamarin Android Support Vector Drawable MSBuild Tasks

For some reason the string was added three times recursively during the build and ended up like


I could fix the build by manually changing <AndroidResgenExtraArgs>$(AndroidResgenExtraArgs)--no-version-vectors</AndroidResgenExtraArgs> to <AndroidResgenExtraArgs>--no-version-vectors</AndroidResgenExtraArgs>
Comment 1 Jonathan Pryor 2016-07-13 18:23:07 UTC
I don't know why `Xamarin.Android.Support.Vector.Drawable.targets` would apparently be imported three times -- that bears further investigation -- but regardless, `Xamarin.Android.Support.Vector.Drawable.targets` should insert a space:

>    <AndroidResgenExtraArgs>$(AndroidResgenExtraArgs) --no-version-vectors</AndroidResgenExtraArgs>

That would cause the resulting thrice-included command line to be `--no-version-vectors --no-version-vectors --no-version-vectors`, which might *still* be invalid, but isn't ridiculous.
Comment 2 Martin Nygren 2016-07-14 09:05:21 UTC
I think you meant to say "which might still be ridiculous, but isn't invalid"
Comment 3 Jon Douglas [MSFT] 2017-07-05 19:25:50 UTC
(In reply to Martin Nygren from comment #2)
> I think you meant to say "which might still be ridiculous, but isn't invalid"

Is this still occurring for you with the most recent version of this library? If it's possible, please upload a sample project with this extra argument defined to demonstrate the behavior. This will help us CONFIRM the behavior and ultimately work on a fix for this. Thus I am marking this as NEEDINFO until we have a reproduction project. Otherwise please provide a small set of reproduction steps to minimally reproduce this issue.

It would also be quite helpful for a full diagnostic build output to spot the duplicate args:


Thank you!
Comment 4 Cody Beyer (MSFT) 2017-08-23 20:49:38 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!