Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aar support in Android.mk

I am doing android custom ROM development now. the build system of aosp is based on Android.mk, But I want to include some aar libraries, is it possible to include aar libaries in Android.mk ?

like image 980
Juude Avatar asked Jul 03 '15 11:07

Juude


1 Answers

My Android.mk

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-common

LOCAL_SRC_FILES := $(call all-java-files-under, app/src)

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/app/src/main/res
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/appcompat/res

LOCAL_MANIFEST_FILE :=  app/src/main/AndroidManifest.xml

LOCAL_PACKAGE_NAME := PackageName

LOCAL_SDK_VERSION := current

LOCAL_PROGUARD_FLAG_FILES := app/proguard-rules.pro

LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat
LOCAL_AAPT_FLAGS += --extra-packages com.exp.librairy

LOCAL_STATIC_JAVA_AAR_LIBRARIES := explibrairy

include $(BUILD_PACKAGE)

#Build aar libs
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_AAR_LIBRARIES := explibrairy:project/build/outputs/aar/explibrairy-debug.aar
include $(BUILD_MULTI_PREBUILT)

include $(call all-makefiles-under, $(LOCAL_PATH))
like image 68
SoulaimenK Avatar answered Oct 03 '22 04:10

SoulaimenK