Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include appcompat_v7 in Android.mk file

Tags:

android

I want my app to be built with Android Source code. How to include appcompat_v7 in Android.mk file and where to place the appcompat_v7 folder in source code. I am using the following code,

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS) 
LOCAL_STATIC_JAVA_LIBRARIES := \appcompat_v7
# Include all java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := MyPackage
include $(BUILD_PACKAGE)

I am getting error

make: No rule to make target 'out/target/common/obj/JAVA_LIBRARIES/\appcompat_v7_intermediates/javalib.jar', needed by 'out/target/common/obj/APPS/MyPackage_intermediates/classes-full-debug.jar'. Stop.

Anyone Please help. Thanks in advance.

like image 709
Nijan Avatar asked Mar 19 '23 09:03

Nijan


1 Answers

I was able to build a package that includes appcompat using the following Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_PACKAGE_NAME := MySuperAwesomeApp

LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-gridlayout
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v13

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

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

LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat:android.support.v7.gridlayout

include $(BUILD_PACKAGE)

Source: https://android.googlesource.com/platform/packages/apps/UnifiedEmail/+/android-5.0.1_r1/Android.mk

like image 84
GaBo Avatar answered Mar 27 '23 12:03

GaBo