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

incompatible_use_aapt2_by_default: Enable Bazel to use aapt2 by default #6907

Open
jin opened this Issue Dec 13, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@jin
Copy link
Member

jin commented Dec 13, 2018

Tracking issue for the incompatible change to switch Bazel to use aapt2 by default.

FR issue: #4103

To switch between aapt versions, Bazel uses the following in order of precedence:

  1. Value of --android_aapt flag.
  2. Value of aapt_version attribute in the android_binary and android_local_test target.
  3. --incompatible_use_aapt2_by_default: false -> aapt, true -> aapt2.

To resolve issues when migrating your app to build with aapt2, see https://developer.android.com/studio/command-line/aapt2#aapt2_changes

@jin jin self-assigned this Dec 13, 2018

@jin jin added the team-Android label Dec 13, 2018

bazel-io pushed a commit that referenced this issue Dec 14, 2018

Add --incompatible_use_aapt2_by_default incompatible change (IC) flag…
… for enabling aapt2 by default in Bazel.

FR Ref: #4103
IC Ref: #6907

RELNOTES: New incompatible change flag for defaulting to aapt2 in Android builds: `--incompatible_use_aapt2_by_default`. To build with aapt2 today, pass the flag `--incompatible_use_aapt2_by_default=true` or `--android_aapt=aapt2`, or set the `aapt_version`  to `aapt2` on your `android_binary` or `android_local_test` target.
PiperOrigin-RevId: 225593174
@jin

This comment has been minimized.

Copy link
Member Author

jin commented Dec 14, 2018

The flag is now in master.

@jin

This comment has been minimized.

Copy link
Member Author

jin commented Dec 17, 2018

The incompatible change flag is expected to enter Bazel 0.22.

@jin jin added the migration-0.22 label Jan 7, 2019

@dslomov dslomov changed the title --incompatible_use_aapt2_by_default: Enable Bazel to use aapt2 by default incompatible_use_aapt2_by_default: Enable Bazel to use aapt2 by default Jan 11, 2019

@dslomov

This comment has been minimized.

Copy link
Contributor

dslomov commented Jan 11, 2019

when are you planning to flip the flag?

@jin

This comment has been minimized.

Copy link
Member Author

jin commented Jan 11, 2019

@dslomov 0.23.

@jin

This comment has been minimized.

Copy link
Member Author

jin commented Feb 1, 2019

Updated plan to flip the flag in 0.24. We are delaying this by one release because of a pending bug fix in 0.23 for android_local_test targets to correctly recognize the aapt version selection.

@jin

This comment has been minimized.

Copy link
Member Author

jin commented Feb 15, 2019

Discovered an issue where building an android_library with --android_aapt=aapt2 causes Bazel to still register an resource validation action that uses aapt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment