diff --git a/core/android_manifest.mk b/core/android_manifest.mk index 0215106f1..3af81ffba 100644 --- a/core/android_manifest.mk +++ b/core/android_manifest.mk @@ -18,18 +18,14 @@ my_full_libs_manifest_files := ifndef LOCAL_DONT_MERGE_MANIFESTS my_full_libs_manifest_files += $(LOCAL_FULL_LIBS_MANIFEST_FILES) - ifdef LOCAL_STATIC_JAVA_AAR_LIBRARIES - my_full_libs_manifest_files += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\ - $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/AndroidManifest.xml) - endif + my_full_libs_manifest_files += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES) $(LOCAL_STATIC_ANDROID_LIBRARIES),\ + $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/manifest/AndroidManifest.xml) endif -ifdef LOCAL_STATIC_JAVA_AAR_LIBRARIES - # With aapt2, we'll link in the built resource from the AAR. - ifneq ($(LOCAL_USE_AAPT2),true) - LOCAL_RESOURCE_DIR += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\ - $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/res) - endif +# With aapt2, we'll link in the built resource from the AAR. +ifneq ($(LOCAL_USE_AAPT2),true) + LOCAL_RESOURCE_DIR += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\ + $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/res) endif full_android_manifest := $(intermediates.COMMON)/manifest/AndroidManifest.xml diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index eab34cd72..17dd04625 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -595,6 +595,10 @@ $(my_src_jar) : $(my_src_aar) $(hide) touch $(dir $@)/proguard.txt $(hide) touch $(dir $@)/AndroidManifest.xml +my_prebuilt_android_manifest := $(intermediates.COMMON)/manifest/AndroidManifest.xml +$(eval $(call copy-one-file,$(my_src_android_manifest),$(my_prebuilt_android_manifest))) +$(call add-dependency,$(LOCAL_BUILT_MODULE),$(my_prebuilt_android_manifest)) + endif $(common_classes_jar) : $(my_src_jar) diff --git a/core/soong_java_prebuilt.mk b/core/soong_java_prebuilt.mk index eeaab315a..0ba2c7a9b 100644 --- a/core/soong_java_prebuilt.mk +++ b/core/soong_java_prebuilt.mk @@ -64,6 +64,10 @@ ifdef LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE my_static_library_extra_packages := $(intermediates.COMMON)/extra_packages $(eval $(call copy-one-file,$(LOCAL_SOONG_STATIC_LIBRARY_EXTRA_PACKAGES),$(my_static_library_extra_packages))) $(call add-dependency,$(LOCAL_BUILT_MODULE),$(my_static_library_extra_packages)) + + my_static_library_android_manifest := $(intermediates.COMMON)/manifest/AndroidManifest.xml + $(eval $(call copy-one-file,$(LOCAL_FULL_MANIFEST_FILE),$(my_static_library_android_manifest))) + $(call add-dependency,$(LOCAL_BUILT_MODULE),$(my_static_library_android_manifest)) endif # LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE ifneq ($(TURBINE_ENABLED),false)