Starting from Android-R It is mandatory for all tech teams to convert Android.mk to Android.bp. No Android.mk support for C/C++/Java compilation
LOCAL_PATH:= $(call my-dir)
# make wrapper static libinclude $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optionalinclude $(BUILD_STATIC_JAVA_LIBRARY)include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optionalLOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_RESOURCE_DIR += frameworks/support/v7/recyclerview/res
LOCAL_AAPT_FLAGS += --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages
LOCAL_AAPT_FLAGS += android.support.v7.recyclerview
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_PRIVILEGED_MODULE := true
Solution:
1. replace the android-support-v4 and android.support.v7 libraries and so that we do not need to access the frameworks/support/v7/recyclerview/res .
2. Change in the .bp and the source code that import the android-support-v4 and android.support.v7 libraries
android_app {
name: "xxxxx"
srcs: ["**/*.java"],
resource_dirs: ["res"],
aaptflags: ["--auto-add-overlay"] + ["--extra-packages"] + ["androidx.recyclerview_recyclerview"],
static_libs: [
"androidx.recyclerview_recyclerview",
"androidx.core_core",
],
product_specific: true,
Issue2: When convert the android.mk to android.bp, $(LOCAL_PATH)/../xxx/res is a relative path and soong have a restriction on using “../” in the path.
Solution: