Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aapt2 & AndroidResgenExtraArgs compatibility #2029

Closed
jonpryor opened this issue Aug 1, 2018 · 2 comments
Closed

Aapt2 & AndroidResgenExtraArgs compatibility #2029

jonpryor opened this issue Aug 1, 2018 · 2 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects.

Comments

@jonpryor
Copy link
Member

jonpryor commented Aug 1, 2018

Context: https://xamarinhq.slack.com/archives/C03CEGRUW/p1533163680000177
Context: #2020 (comment)

As the Xamarin.Android.Support.Vector.Drawable NuGet package overrides $(AndroidResgenExtraArgs) and won't override the related aapt2 properties -- because they don't yet exist in any usable form -- there is a concern that any existing projects which use the Xamarin.Android.Support.Vector.Drawable package and enable aapt2 may suffer a build failure.

Possible (hackish?) workaround: update the <Aapt2Link/> (<Aapt2Compile/>?) target so that it also accepts $(AndroidResgenExtraArgs), and does something like:

if (AndroidResgenExtraArgs.Contains ("--no-version-vectors"))
    ExtraArgs += " --no-version-vectors";
@jonpryor jonpryor added the Area: App+Library Build Issues when building Library projects or Application projects. label Aug 1, 2018
@dellis1972
Copy link
Contributor

dellis1972 commented Aug 2, 2018

Or better

<PropertyGroup>
   <AndroidAap2LinkExtraArgs Condition=" '$(_AndroidUseAapt2)' == 'True' And $(AndroidResgenExtraArgs.Contains('--no-version-vectors')) And !($(AndroidAap2LinkExtraArgs.Contains('--no-version-vectors'))) ">--no-version-vectors $(AndroidAap2LinkExtraArgs) </AndroidAap2LinkExtraArgs>
</PropertyGroup>

dellis1972 added a commit to dellis1972/xamarin-android that referenced this issue Aug 2, 2018
…ility

Fixes dotnet#2029

The Xamarin.Android.Support.Vector.Drawable [1] NuGet package
overrides `$(AndroidResgenExtraArgs)` with `--no-version-vectors`.
Since 77d603a `aapt2` now has its own properties for `link` and
`compile`. As a result people using `aapt2` are likely to encounter
issues when using the above Nuget Package.

To help our users we can auto detect if the `--no-version-vectors`
is set in the `$(AndroidResgenExtraArgs)` property and auto
include that into the new `$(AndroidAap2LinkExtraArgs)` property
(if it does not contain it already). This will hopefully provide
a smooth transiton for users using `aapt2`.

Note `$(AndroidAap2CompileExtraArgs)` does NOT need the same argument
since is it not a valid argument for the `compile` task.

[1] https://www.nuget.org/packages/Xamarin.Android.Support.Vector.Drawable/27.0.2.1
@dellis1972
Copy link
Contributor

PR up #2032

dellis1972 added a commit to dellis1972/xamarin-android that referenced this issue Aug 2, 2018
…ility

Fixes dotnet#2029

The Xamarin.Android.Support.Vector.Drawable [1] NuGet package
overrides `$(AndroidResgenExtraArgs)` with `--no-version-vectors`.
Since 77d603a `aapt2` now has its own properties for `link` and
`compile`. As a result people using `aapt2` are likely to encounter
issues when using the above Nuget Package.

To help our users we can auto detect if the `--no-version-vectors`
is set in the `$(AndroidResgenExtraArgs)` property and auto
include that into the new `$(AndroidAap2LinkExtraArgs)` property
(if it does not contain it already). This will hopefully provide
a smooth transiton for users using `aapt2`.

Note `$(AndroidAap2CompileExtraArgs)` does NOT need the same argument
since is it not a valid argument for the `compile` task.

[1] https://www.nuget.org/packages/Xamarin.Android.Support.Vector.Drawable/27.0.2.1
jonpryor pushed a commit that referenced this issue Aug 6, 2018
…2032)

Fixes: #2029

The [Xamarin.Android.Support.Vector.Drawable][1] NuGet package
overrides `$(AndroidResgenExtraArgs)` with `--no-version-vectors`.
Since 77d603a `aapt2` now has its own properties for `link` and
`compile`.  As a result people using `aapt2` are likely to encounter
issues when using the above NuGet Package.

To help our users we can auto detect if the `--no-version-vectors` is
set in the `$(AndroidResgenExtraArgs)` property and auto include that
into the new `$(AndroidAap2LinkExtraArgs)` property (if it does not
contain it already).  This will hopefully provide a smooth transition
for users using `aapt2`.

Note `$(AndroidAap2CompileExtraArgs)` does NOT need the same argument
since is it not a valid argument for the `compile` task.

[1]: https://www.nuget.org/packages/Xamarin.Android.Support.Vector.Drawable/27.0.2.1
jonpryor pushed a commit that referenced this issue Aug 6, 2018
…2032)

Fixes: #2029

The [Xamarin.Android.Support.Vector.Drawable][1] NuGet package
overrides `$(AndroidResgenExtraArgs)` with `--no-version-vectors`.
Since 77d603a `aapt2` now has its own properties for `link` and
`compile`.  As a result people using `aapt2` are likely to encounter
issues when using the above NuGet Package.

To help our users we can auto detect if the `--no-version-vectors` is
set in the `$(AndroidResgenExtraArgs)` property and auto include that
into the new `$(AndroidAap2LinkExtraArgs)` property (if it does not
contain it already).  This will hopefully provide a smooth transition
for users using `aapt2`.

Note `$(AndroidAap2CompileExtraArgs)` does NOT need the same argument
since is it not a valid argument for the `compile` task.

[1]: https://www.nuget.org/packages/Xamarin.Android.Support.Vector.Drawable/27.0.2.1
@ghost ghost locked as resolved and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

No branches or pull requests

2 participants