Struggling to build aapt/aapt2

Skip to first unread message

Connor Tumbleson

May 14, 2024, 11:00:51 AMMay 14
to Android Building

After my last sync I knew something was off - I missed the announcement of master to main. So I swapped out the entire tree and re-synced (-c -j8).

└─$ repo sync -c -j8
Fetching: 100% (1376/1376), done in 1m12.709s
Checking out: 100% (1376/1376), done in 21.502s
repo sync has finished successfully.

Once done I did my classic.

source build/
m aapt
m aapt2

This failed immediately with

> build/make/core/ error: No release config set for target; please set TARGET_RELEASE, or if building on the command line use 'lunch <target>-<release>-<build_type>', where release is one of: next protobuf_flags trunk
trunk_food trunk_staging.

So I thought I would do "lunch sdk-eng" which failed

Invalid lunch combo: sdk-eng
Valid combos must be of the form <product>-<release>-<variant>

So I try lunch sdk-trunk-eng which fails, so then I try and run "lunch" to figure out what I'm missing

└─$ lunch

You're building on Linux
Warning: Cannot display lunch menu.

I'm just lost - all I want to do is build aapt & aapt2 and I'm struggling.

Anurag Kumar

May 14, 2024, 11:22:39 AMMay 14
google changed lunching a little bit, instead of release variant "trunk" do "ap1a"
like this: sdk-ap1a-eng

From: <> on behalf of Connor Tumbleson <>
Sent: 14 May 2024 04:03 PM
To: Android Building <>
Subject: [android-building] Struggling to build aapt/aapt2
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Anurag Kumar

May 14, 2024, 11:22:51 AMMay 14
or you can try lunch sdk-trunk_staging-eng

From: Anurag Kumar <>
Sent: 14 May 2024 08:46 PM
To: <>
Subject: Re: [android-building] Struggling to build aapt/aapt2


May 14, 2024, 12:06:35 PMMay 14
yeah, the format of lunches changed recently. it's pretty annoying
(and i don't think there's any high-level documentation of what it
means or why).

but if you look at (say) you can see
a new lunch that _does_ work (which is basically following the advice
from the error message, but contains a concrete example of what a
new-format lunch looks like).

Connor Tumbleson

May 21, 2024, 11:31:38 AMMay 21
to Android Building
Thanks, but I don't have much luck with either option.

I see you got ap1a from the latest build ids. That resulted in

> build/make/core/ error: release-config failed to run.
> 06:16:58 dumpvars failed with: exit status 1

It worked well with trunk_staging, but failed compilation of aapt (or aapt2) with so many errors about undefined modules.

> error: external/kotlinx.coroutines/Android.bp:239:1: "kotlinx_coroutines_reactive" depends on undefined module "rxjava".
> Or did you mean ["guava" "javap" "xz-java"]?
> error: tools/tradefederation/core/aoa_helper/Android.bp:19:1: "aoa-helper" depends on undefined module "jna-prebuilt".
> Or did you mean ["json-prebuilt"]?
> error: external/dokka/Android.bp:38:1: "dokka" depends on undefined module "dokka-tools-common-m2-deps".
+ 20 more

In the past - I didn't really have to invoke lunch at all. I could run envsetup, then just run "m aapt". Do you know what the default target was prior to being required to invoking lunch?
Reply all
Reply to author
0 new messages