From 6d38503400d7175baba1356f939cb50c5978a50e Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 27 Apr 2017 23:10:47 -0700 Subject: [PATCH] More aapt2 aar prebuilt fixes Ensure aar/res exists, otherwise aapt2 may fail with an error. Bug: 33381544 Test: Attempt to build aar prebuilt Change-Id: Ifbeed546fe1a3a48c3dae33f95b04acc559f5b30 Merged-In: Ifbeed546fe1a3a48c3dae33f95b04acc559f5b30 (cherry picked from commit 7a1ad6c8a06b5a328c8a59667e3980ed158d47fa) --- core/prebuilt_internal.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index e934c2180d..c12084fd2b 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -498,7 +498,7 @@ ifneq ($(my_src_aar),) my_src_jar := $(intermediates.COMMON)/aar/classes.jar $(my_src_jar) : $(my_src_aar) - $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) + $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) $(dir $@)/res $(hide) unzip -qo -d $(dir $@) $< # Make sure the extracted classes.jar has a new timestamp. $(hide) touch $@ @@ -543,6 +543,7 @@ my_res_package := $(intermediates.COMMON)/package-res.apk # We needed only very few PRIVATE variables and aapt2.mk input variables. Reset the unnecessary ones. $(my_res_package): PRIVATE_AAPT2_CFLAGS := +$(my_res_package): PRIVATE_AAPT_FLAGS := --static-lib --no-static-lib-packages $(my_res_package): PRIVATE_ANDROID_MANIFEST := $(intermediates.COMMON)/aar/AndroidManifest.xml $(my_res_package): PRIVATE_AAPT_INCLUDES := $(framework_res_package_export) $(my_res_package): PRIVATE_SOURCE_INTERMEDIATES_DIR :=