I have been trying to add an aar file to my application developed with the AOSP using the following section of my Android.mk
:
...
LOCAL_STATIC_JAVA_AAR_LIBRARIES := \
aar-lib
LOCAL_AAPT_FLAGS := --auto-add-overlay \
--extra-packages com.mypackage.name
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
aar-libr:libs/aarname.aar
...
A bunch of immediates are created in the out/target/common/obj/JAVA_LIBRARIES
and in the out/target/common/R
folder. However, I do not seem to be able to actually import the packages contained in the aar. For example, the aar itself contains a libs
folder with a classes.jar
archive. But the import statements for contained classes cause errors when building.
I am working with the target sdk version 28. Is there a way to resolve these dependency issues?